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

Maximum #17942

Merged
merged 20 commits into from
Jul 21, 2023
Merged
4 changes: 4 additions & 0 deletions ivy/functional/frontends/paddle/tensor/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ def equal_all(self, y, name=None):
ivy.array_equal(self._ivy_array, _to_ivy_array(y))
)

@with_supported_dtypes({"2.5.0 and below": ("float32", "float64")}, "paddle")
def maximum(self, other, name=None):
return ivy.maximum(self._ivy_array, other)

@with_unsupported_dtypes({"2.5.0 and below": "bfloat16"}, "paddle")
def fmax(self, y, name=None):
return paddle_frontend.Tensor(ivy.fmax(self._ivy_array, _to_ivy_array(y)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# flake8: noqa
# global
import numpy as np
Arwa45 marked this conversation as resolved.
Show resolved Hide resolved
from hypothesis import assume, given
from hypothesis import strategies as st

import ivy

# local
Expand Down Expand Up @@ -2721,6 +2719,41 @@ def test_paddle_instance_min(
)


# maximum
@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="paddle.to_tensor",
method_name="maximum",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
num_arrays=2,
shared_dtype=True,
),
)
def test_paddle_instance_maximum(
dtype_and_x,
frontend_method_data,
init_flags,
method_flags,
frontend,
on_device,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_method(
init_input_dtypes=input_dtype,
init_all_as_kwargs_np={
"data": x[0],
},
method_input_dtypes=input_dtype,
method_all_as_kwargs_np={"other": x[1]},
frontend=frontend,
frontend_method_data=frontend_method_data,
init_flags=init_flags,
method_flags=method_flags,
on_device=on_device,
)


# std
@handle_frontend_method(
class_tree=CLASS_TREE,
Expand Down
Loading