Skip to content

Commit

Permalink
fix: Handled a case in handle_methods where attribute retrieved is ac…
Browse files Browse the repository at this point in the history
…tually not a callable and is all we need to return without calling it e.g. when calling .data on a class object
  • Loading branch information
hmahmood24 committed Sep 2, 2024
1 parent 4aeab3c commit 5c7cc4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ivy/utils/decorator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ def wrapper(*args, **kwargs):
fn_name = extract_function_name(re.sub(pattern, "", fn.__name__))
try:
new_fn = getattr(array_like, fn_name)
if not callable(new_fn):
return new_fn
return new_fn(*args[1:], **kwargs)
except AttributeError:
return fn(*args, **kwargs)
Expand Down Expand Up @@ -418,7 +420,7 @@ def transpose_wrapper(self, *args, **kwargs):


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

0 comments on commit 5c7cc4c

Please sign in to comment.