Skip to content

Commit

Permalink
Isreal function (#10742)
Browse files Browse the repository at this point in the history
* Added cosh instance method to pytorch frontend

Co-authored-by: YushaArif<[email protected]>
  • Loading branch information
usama-baloch authored Feb 24, 2023
1 parent e6c8c3c commit 7248f15
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ivy/functional/frontends/jax/numpy/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,8 @@ def isscalar(x, /):
@to_ivy_arrays_and_back
def left_shift(x1, x2):
return ivy.isscalar(x1, x2)


@to_ivy_arrays_and_back
def isreal(x, out=None):
return ivy.isreal(x, out=out)
33 changes: 33 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_jax/test_jax_numpy_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,3 +793,36 @@ def test_jax_numpy_left_shift(
on_device=on_device,
x=x[0],
)


# isreal
@handle_frontend_test(
fn_tree="jax.numpy.isreal",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
min_value=-np.inf,
max_value=np.inf,
min_num_dims=1,
max_num_dims=3,
min_dim_size=1,
max_dim_size=3,
allow_inf=True,
),
)
def test_jax_numpy_isreal(
*,
dtype_and_x,
on_device,
fn_tree,
frontend,
test_flags,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
x=x[0],
)

0 comments on commit 7248f15

Please sign in to comment.