diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py index fe77359ee5f76..2fc5a64bed3a8 100644 --- a/ivy/functional/frontends/paddle/tensor/tensor.py +++ b/ivy/functional/frontends/paddle/tensor/tensor.py @@ -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))) diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py index b02326cb8a468..6dab8a7c273cc 100644 --- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py +++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_tensor.py @@ -1,8 +1,6 @@ +# flake8: noqa # global import numpy as np -from hypothesis import assume, given -from hypothesis import strategies as st - import ivy # local @@ -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,