Skip to content

Commit

Permalink
Added Conj mathematical function to JAX Frontend (#11136)
Browse files Browse the repository at this point in the history
Co-authored by: Yusha Arif <[email protected]>
  • Loading branch information
usama-baloch authored Mar 6, 2023
1 parent 19b832c commit 93a8ff2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
9 changes: 6 additions & 3 deletions ivy/functional/frontends/jax/numpy/mathematical_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,16 @@ def inner(a, b):
a, b = promote_types_of_jax_inputs(a, b)
return ivy.inner(a, b)


@to_ivy_arrays_and_back

def outer(a, b, out=None):
return ivy.outer(a, b, out=out)


@to_ivy_arrays_and_back
def reciprocal(x, /):
return ivy.reciprocal(x)



@to_ivy_arrays_and_back
def conj(x, /):
return ivy.conj(x)
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,7 @@ def test_jax_numpy_inner(
)


# outer
@handle_frontend_test(
fn_tree="jax.numpy.outer",
dtype_and_x=helpers.dtype_and_values(
Expand Down Expand Up @@ -2362,4 +2363,30 @@ def test_jax_numpy_reciprocal(
on_device=on_device,
x=x[0],
)



# conj
@handle_frontend_test(
fn_tree="jax.numpy.conj",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
)
)
def test_jax_numpy_conj(
*,
dtype_and_x,
test_flags,
on_device,
fn_tree,
frontend,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
test_flags=test_flags,
frontend=frontend,
fn_tree=fn_tree,
on_device=on_device,
x=x[0],
)

0 comments on commit 93a8ff2

Please sign in to comment.