Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added arrcos, arrcosh, arcsin, arcsinh to jax.numpy frontend namespace functions #5675

Merged
merged 7 commits into from
Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ivy/functional/frontends/jax/numpy/name_space_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,26 @@ def sin(x):
return ivy.sin(x)


@inputs_to_ivy_arrays
def arccos(x):
return ivy.acos(x)


@inputs_to_ivy_arrays
def arccosh(x):
return ivy.acosh(x)


@inputs_to_ivy_arrays
def arcsin(x):
return ivy.asin(x)


@inputs_to_ivy_arrays
def arcsinh(x):
return ivy.asinh(x)


@inputs_to_ivy_arrays
def fmax(x1, x2):
ret = ivy.where(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -984,3 +984,127 @@ def test_jax_numpy_zeros(
shape=shape,
dtype=dtypes[0],
)


# arccos
@handle_cmd_line_args
@given(
dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("float")),
dtype=helpers.get_dtypes("float", full=False, none=True),
num_positional_args=helpers.num_positional_args(
fn_name="ivy.functional.frontends.jax.numpy.arccos"
),
)
def test_jax_numpy_arccos(
dtype_and_x,
dtype,
as_variable,
with_out,
num_positional_args,
native_array,
fw,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
as_variable_flags=as_variable,
with_out=with_out,
num_positional_args=num_positional_args,
native_array_flags=native_array,
frontend="jax",
fn_tree="numpy.arccos",
x=x[0],
)


# arccosh
@handle_cmd_line_args
@given(
dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("float")),
dtype=helpers.get_dtypes("float", full=False, none=True),
num_positional_args=helpers.num_positional_args(
fn_name="ivy.functional.frontends.jax.numpy.arccosh"
),
)
def test_jax_numpy_arccosh(
dtype_and_x,
dtype,
as_variable,
with_out,
num_positional_args,
native_array,
fw,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
as_variable_flags=as_variable,
with_out=with_out,
num_positional_args=num_positional_args,
native_array_flags=native_array,
frontend="jax",
fn_tree="numpy.arccosh",
x=x[0],
)


# arcsin
@handle_cmd_line_args
@given(
dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("float")),
dtype=helpers.get_dtypes("float", full=False, none=True),
num_positional_args=helpers.num_positional_args(
fn_name="ivy.functional.frontends.jax.numpy.arcsin"
),
)
def test_jax_numpy_arcsin(
dtype_and_x,
dtype,
as_variable,
with_out,
num_positional_args,
native_array,
fw,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
as_variable_flags=as_variable,
with_out=with_out,
num_positional_args=num_positional_args,
native_array_flags=native_array,
frontend="jax",
fn_tree="numpy.arcsin",
x=x[0],
)


# arcsinh
@handle_cmd_line_args
@given(
dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("float")),
dtype=helpers.get_dtypes("float", full=False, none=True),
num_positional_args=helpers.num_positional_args(
fn_name="ivy.functional.frontends.jax.numpy.arcsinh"
),
)
def test_jax_numpy_arcsinh(
dtype_and_x,
dtype,
as_variable,
with_out,
num_positional_args,
native_array,
fw,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
as_variable_flags=as_variable,
with_out=with_out,
num_positional_args=num_positional_args,
native_array_flags=native_array,
frontend="jax",
fn_tree="numpy.arcsinh",
x=x[0],
)