Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion torchx/specs/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ def _get_path_to_function_decl(
my_component defined in some_file.py, imported in other_file.py
and the component is invoked as other_file.py:my_component
"""
path_to_function_decl = inspect.getabsfile(function)
# Unwrap decorated functions to get the original function
unwrapped_function = inspect.unwrap(function)
path_to_function_decl = inspect.getabsfile(unwrapped_function)
if path_to_function_decl is None or not os.path.isfile(path_to_function_decl):
return self._filepath
return path_to_function_decl
Expand Down
Loading