From d04a725003391d6756b62d276e86145df32126e4 Mon Sep 17 00:00:00 2001 From: Aaryan562 <82304628+Aaryan562@users.noreply.github.com> Date: Fri, 1 Sep 2023 02:25:08 +0530 Subject: [PATCH 1/2] Update tensor.py --- ivy/functional/frontends/paddle/tensor/tensor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py index aa43fe6c9566b..8fbc8546ff2a7 100644 --- a/ivy/functional/frontends/paddle/tensor/tensor.py +++ b/ivy/functional/frontends/paddle/tensor/tensor.py @@ -584,7 +584,7 @@ def cond(self, p=None, name=None): @with_unsupported_dtypes({"2.4.2 and below": ("int16", "float16")}, "paddle") def conj(self, name=None): return paddle_frontend.Tensor(ivy.conj(self._ivy_array)) - + @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle") def log2(self, name=None): return paddle_frontend.Tensor(ivy.log2(self._ivy_array)) @@ -658,6 +658,12 @@ def std(self, axis=None, unbiased=True, keepdim=False, name=None): def trunc(self, name=None): return paddle_frontend.Tensor(ivy.trunc(self._ivy_array)) + @with_supported_dtypes( + {"2.5.1 and below": ("int32", "int64", "float32", "float64")}, "paddle" + ) + def pow(self, y, name=None): + return paddle_frontend.Tensor(ivy.pow(self._ivy_array, _to_ivy_array(y))) + @with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle") def remainder(self, y, name=None): return ivy.remainder(self._ivy_array, y) From 705044d4fcf7465df18c1d3a008ff97e6b02e9e3 Mon Sep 17 00:00:00 2001 From: Aaryan562 <82304628+Aaryan562@users.noreply.github.com> Date: Fri, 1 Sep 2023 02:26:54 +0530 Subject: [PATCH 2/2] Update test_tensor.py --- .../test_paddle/test_tensor/test_tensor.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) 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 b361284f390e1..03bcc48bc342b 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 @@ -2355,6 +2355,42 @@ def test_paddle_tensor_numel( ) +# pow +@handle_frontend_method( + class_tree=CLASS_TREE, + init_tree="paddle.to_tensor", + method_name="pow", + dtypes_and_x=helpers.dtype_and_values( + available_dtypes=helpers.get_dtypes("float"), + num_arrays=2, + allow_inf=False, + shared_dtype=True, + ), +) +def test_paddle_tensor_pow( + dtypes_and_x, + frontend_method_data, + init_flags, + method_flags, + frontend, + on_device, + backend_fw, +): + input_dtype, x = dtypes_and_x + helpers.test_frontend_method( + init_input_dtypes=input_dtype, + backend_to_test=backend_fw, + init_all_as_kwargs_np={"data": x[0]}, + method_input_dtypes=input_dtype, + method_all_as_kwargs_np={"y": x[1]}, + frontend_method_data=frontend_method_data, + init_flags=init_flags, + method_flags=method_flags, + frontend=frontend, + on_device=on_device, + ) + + # rad2deg @handle_frontend_method( class_tree=CLASS_TREE,