Skip to content

Commit

Permalink
experimental to frontend test
Browse files Browse the repository at this point in the history
  • Loading branch information
bilal-aamer committed Aug 15, 2023
1 parent bb0509e commit 4719637
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,3 +674,33 @@ def test_paddle_rot90(
k=k,
axes=tuple(axes),
)


# unique
@handle_frontend_test(
fn_tree="paddle.unique",
dtype_x_axis=helpers.dtype_values_axis(
available_dtypes=helpers.get_dtypes("numeric"),
min_num_dims=1,
min_dim_size=2,
force_int_axis=True,
valid_axis=True,
),
none_axis=st.booleans(),
test_with_out=st.just(False),
test_gradients=st.just(False),
ground_truth_backend="torch",
)
def test_unique(*, dtype_x_axis, none_axis, test_flags, backend_fw, fn_name, on_device):
dtype, x, axis = dtype_x_axis
if none_axis:
axis = None
helpers.test_function(
input_dtypes=dtype,
test_flags=test_flags,
backend_to_test=backend_fw,
fn_name=fn_name,
on_device=on_device,
x=x,
axis=axis,
)
Original file line number Diff line number Diff line change
Expand Up @@ -959,36 +959,6 @@ def test_associative_scan(
)


# unique
@handle_test(
fn_tree="unique",
dtype_x_axis=helpers.dtype_values_axis(
available_dtypes=helpers.get_dtypes("numeric"),
min_num_dims=1,
min_dim_size=2,
force_int_axis=True,
valid_axis=True,
),
none_axis=st.booleans(),
test_with_out=st.just(False),
test_gradients=st.just(False),
ground_truth_backend="torch",
)
def test_unique(*, dtype_x_axis, none_axis, test_flags, backend_fw, fn_name, on_device):
dtype, x, axis = dtype_x_axis
if none_axis:
axis = None
helpers.test_function(
input_dtypes=dtype,
test_flags=test_flags,
backend_to_test=backend_fw,
fn_name=fn_name,
on_device=on_device,
x=x,
axis=axis,
)


# unique_consecutive
@handle_test(
fn_tree="unique_consecutive",
Expand Down

0 comments on commit 4719637

Please sign in to comment.