Skip to content

Commit

Permalink
fix: Function Reformatting of is_int_dtype function (ivy-llc#23695)
Browse files Browse the repository at this point in the history
Co-authored-by: bipinkrishnan <[email protected]>
  • Loading branch information
pavan999999999 and bipinKrishnan authored Sep 23, 2023
1 parent c956029 commit 8b9a043
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions ivy/functional/ivy/data_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -1910,18 +1910,14 @@ def is_int_dtype(
else False
)
elif isinstance(dtype_in, (list, tuple, dict)):
return (
True
if ivy.nested_argwhere(
dtype_in,
lambda x: (
isinstance(x, (int, np.integer))
or (ivy.is_array(x) and "int" in ivy.dtype(x))
)
and x is not bool,
)
else False
)

def nested_fun(x):
return (
isinstance(x, (int, np.integer))
or (ivy.is_array(x) and "int" in ivy.dtype(x))
) and x is not bool

return True if ivy.nested_argwhere(dtype_in, nested_fun) else False
return "int" in ivy.as_ivy_dtype(dtype_in)


Expand Down

0 comments on commit 8b9a043

Please sign in to comment.