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

argmin #17061 #17058

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 4 additions & 0 deletions ivy/functional/frontends/paddle/tensor/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
@to_ivy_arrays_and_back
def argmax(x, /, *, axis=None, keepdim=False, dtype="int64", name=None):
return ivy.argmax(x, axis=axis, keepdims=keepdim, dtype=dtype)

@to_ivy_arrays_and_back
def argmin(x, /, *, axis=None, keepdim=False, dtype="int64", name=None):
return ivy.argmin(x, axis=axis, keepdims=keepdim, dtype=dtype)
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,33 @@ def test_paddle_argmax(
axis=axis,
keepdim=keepdim,
)

@handle_frontend_test(
fn_tree="paddle.argmin",
dtype_x_and_axis=helpers.dtype_values_axis(
available_dtypes=helpers.get_dtypes("valid"),
min_num_dims=1,
valid_axis=True,
force_int_axis=True,
),
keepdim=st.booleans(),
)
def test_paddle_argmin(
dtype_x_and_axis,
keepdim,
frontend,
test_flags,
fn_tree,
):
# Skipped dtype test due to paddle functions only accepting str and np.ndarray,
# but test_frontend_function changes dtype kwargs to native dtype
input_dtypes, x, axis = dtype_x_and_axis
helpers.test_frontend_function(
input_dtypes=input_dtypes,
frontend=frontend,
test_flags=test_flags,
fn_tree=fn_tree,
x=x[0],
axis=axis,
keepdim=keepdim,
)