Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jun Gong committed Feb 6, 2023
1 parent 373fff8 commit 247d5f0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions python/ray/tune/impl/placeholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,6 @@ def _get_placeholder(config: Any, prefix: Tuple, path: Tuple):
return prefix, config

key = path[0]
if (isinstance(config, dict) and key in config) or (
isinstance(config, list) and key < len(config)
):
# Expand config tree recursively.
return _get_placeholder(config[key], prefix=prefix + (path[0],), path=path[1:])

if isinstance(config, tuple):
if config[0] in (_FunctionResolver.TOKEN, _RefResolver.TOKEN):
# Found a matching placeholder.
Expand All @@ -207,6 +201,11 @@ def _get_placeholder(config: Any, prefix: Tuple, path: Tuple):
return _get_placeholder(
config[key], prefix=prefix + (path[0],), path=path[1:]
)
elif (isinstance(config, dict) and key in config) or (
isinstance(config, list) and key < len(config)
):
# Expand config tree recursively.
return _get_placeholder(config[key], prefix=prefix + (path[0],), path=path[1:])

# Can not find a matching placeholder.
return None, None
Expand Down

0 comments on commit 247d5f0

Please sign in to comment.