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 any to paddle math #19553

Merged
merged 18 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from 9 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
5 changes: 5 additions & 0 deletions ivy/functional/frontends/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,8 @@ def lerp(x, y, weight, name=None):
@to_ivy_arrays_and_back
def rsqrt(x, name=None):
return 1 / ivy.sqrt(x)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing supported dtypes

@to_ivy_arrays_and_back
def any(x, axis=None, keepdim=False, name=None):
return ivy.max(x, axis=axis, keepdims=keepdim)
sroycho4 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# global
from hypothesis import strategies as st

# local
import ivy_tests.test_ivy.helpers as helpers
Expand Down Expand Up @@ -1709,3 +1710,37 @@ def test_paddle_rsqrt(
on_device=on_device,
x=x[0],
)


# any
@handle_frontend_test(
fn_tree="paddle.tensor.math.any",
dtype_and_x=helpers.dtype_values_axis(
available_dtypes=helpers.get_dtypes("bool"),
valid_axis=True,
allow_neg_axes=True,
min_num_dims=1,
force_int_axis=False,
),
keepdim=st.booleans(),
)
def test_paddle_any(
*,
dtype_and_x,
keepdim,
on_device,
fn_tree,
frontend,
test_flags,
):
input_dtype, x, axis = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
x=x[0],
axis=axis,
keepdim=keepdim,
)