Skip to content

Commit 5c7cc4c

Browse files
committed
fix: Handled a case in handle_methods where attribute retrieved is actually not a callable and is all we need to return without calling it e.g. when calling .data on a class object
1 parent 4aeab3c commit 5c7cc4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ivy/utils/decorator_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ def wrapper(*args, **kwargs):
169169
fn_name = extract_function_name(re.sub(pattern, "", fn.__name__))
170170
try:
171171
new_fn = getattr(array_like, fn_name)
172+
if not callable(new_fn):
173+
return new_fn
172174
return new_fn(*args[1:], **kwargs)
173175
except AttributeError:
174176
return fn(*args, **kwargs)
@@ -418,7 +420,7 @@ def transpose_wrapper(self, *args, **kwargs):
418420

419421

420422
# TODO: temp fix for `ivy.inplace_update`. Dont quite understand the way this function
421-
# has been implemented in the backends as it seems to also have ivy.Array specific logic.
423+
# has been implemented in the backends as it seems to also have ivy.Array specific logic
422424
# In the case where both x, and val are arrays, it simply returns x (why??)
423425
# perhaps we can rewrite it in a cleaner format and then remove this fix
424426
def dummy_inplace_update(x, val, /, *, ensure_in_backend=False, keep_input_dtype=False):

0 commit comments

Comments
 (0)