diff --git a/ivy/transpiler/utils/inspect_utils.py b/ivy/transpiler/utils/inspect_utils.py index 43ae29e77bb16..947b4606d3fee 100644 --- a/ivy/transpiler/utils/inspect_utils.py +++ b/ivy/transpiler/utils/inspect_utils.py @@ -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(