Skip to content

Commit

Permalink
fix: slightly incorrect check for objects belonging to ivy
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Jan 16, 2025
1 parent 026cee8 commit 8bf39fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ivy/transpiler/utils/inspect_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ def _validate_object(object: Union[FunctionType, MethodType, type], source: str)
)

# Check if the object belongs to the Ivy framework
if hasattr(object, "__module__") and object.__module__.startswith("ivy."):
if (
hasattr(object, "__module__") and
object.__module__.startswith("ivy.") and
"ivy.transpiler" not in object.__module__
):
if source == "ivy":
return object
raise InvalidSourceException(
Expand Down

0 comments on commit 8bf39fc

Please sign in to comment.