From 8bf39fcb3f9896c29ee56cadb6e0879647a3d289 Mon Sep 17 00:00:00 2001 From: Sam Armstrong <88863522+Sam-Armstrong@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:12:34 +0000 Subject: [PATCH] fix: slightly incorrect check for objects belonging to ivy --- ivy/transpiler/utils/inspect_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(