Skip to content

Commit

Permalink
jax_flipud (#5908)
Browse files Browse the repository at this point in the history
Co-authored-by: nassimberrada <Nassim>
  • Loading branch information
nassimberrada authored Oct 22, 2022
1 parent b5b5d09 commit 73ed634
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ivy/functional/frontends/jax/numpy/name_space_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,8 @@ def bitwise_and(x1, x2):
@to_ivy_arrays_and_back
def moveaxis(a, source, destination):
return ivy.moveaxis(a, source, destination)


@to_ivy_arrays_and_back
def flipud(m):
return ivy.flipud(m, out=None)
Original file line number Diff line number Diff line change
Expand Up @@ -1377,3 +1377,38 @@ def test_jax_numpy_moveaxis(
source=source,
destination=destination,
)


# flipud
@handle_cmd_line_args
@given(
dtype_and_m=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
min_value=-100,
max_value=100,
min_num_dims=1,
max_num_dims=3,
min_dim_size=1,
max_dim_size=3,
),
num_positional_args=helpers.num_positional_args(
fn_name="ivy.functional.frontends.jax.numpy.flipud"
),
)
def test_jax_numpy_flipud(
dtype_and_m,
as_variable,
num_positional_args,
native_array,
):
input_dtype, m = dtype_and_m
helpers.test_frontend_function(
input_dtypes=input_dtype,
as_variable_flags=as_variable,
with_out=False,
num_positional_args=num_positional_args,
native_array_flags=native_array,
frontend="jax",
fn_tree="numpy.flipud",
m=np.asarray(m[0], dtype=input_dtype[0]),
)

0 comments on commit 73ed634

Please sign in to comment.