From 6a40b27d5dbfbf80e301ce217c067e781e360d62 Mon Sep 17 00:00:00 2001 From: ivy-branch Date: Sun, 3 Mar 2024 10:31:04 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Lint=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontends/paddle/tensor/tensor.py | 2 - .../test_paddle/test_tensor/test_tensor.py | 82 +++++++++---------- 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py index 215f5a98bf183..cb81fee011429 100644 --- a/ivy/functional/frontends/paddle/tensor/tensor.py +++ b/ivy/functional/frontends/paddle/tensor/tensor.py @@ -1244,7 +1244,6 @@ def expand(self, shape, name=None): def tile(self, repeat_times): return paddle_frontend.Tensor(ivy.tile(self._ivy_array, repeats=repeat_times)) - @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle") def cholesky_solve(self, y, upper=False, name=None): return paddle_frontend.cholesky_solve(self._ivy_array, y, upper=upper) @@ -1266,4 +1265,3 @@ def cholesky_solve(self, y, upper=False, name=None): ) def chunk(self, chunks, axis=0, name=None): return paddle_frontend.split(self._ivy_array, num_or_sections=chunks, axis=axis) - 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 40b1cfa836440..f9e6915f9b0dc 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 @@ -5755,6 +5755,47 @@ def test_paddle_tensor_add( ) +# _solve +@handle_frontend_method( + class_tree=CLASS_TREE, + init_tree="paddle.to_tensor", + method_name="cholesky_solve", + dtype_and_x=_get_second_matrix(), + dtype_and_y=_get_cholesky_matrix(), +) +def test_paddle_tensor_cholesky_solve( + dtype_and_x, + dtype_and_y, + frontend_method_data, + init_flags, + method_flags, + frontend, + on_device, + backend_fw, +): + input_dtype1, x = dtype_and_x + input_dtype2, y = dtype_and_y + helpers.test_frontend_method( + init_input_dtypes=[input_dtype1, input_dtype2], + backend_to_test=backend_fw, + init_all_as_kwargs_np={ + "data": x, + }, + method_input_dtypes=[input_dtype1, input_dtype2], + method_all_as_kwargs_np={ + "y": y, + "upper": np.array_equal(y, np.triu(y)), + }, + frontend_method_data=frontend_method_data, + init_flags=init_flags, + method_flags=method_flags, + frontend=frontend, + on_device=on_device, + rtol_=1e-3, + atol_=1e-3, + ) + + # chunk @handle_frontend_method( class_tree=CLASS_TREE, @@ -6100,47 +6141,6 @@ def test_paddle_tensor_squeeze( ) -# _solve -@handle_frontend_method( - class_tree=CLASS_TREE, - init_tree="paddle.to_tensor", - method_name="cholesky_solve", - dtype_and_x=_get_second_matrix(), - dtype_and_y=_get_cholesky_matrix(), -) -def test_paddle_tensor_cholesky_solve( - dtype_and_x, - dtype_and_y, - frontend_method_data, - init_flags, - method_flags, - frontend, - on_device, - backend_fw, -): - input_dtype1, x = dtype_and_x - input_dtype2, y = dtype_and_y - helpers.test_frontend_method( - init_input_dtypes=[input_dtype1, input_dtype2], - backend_to_test=backend_fw, - init_all_as_kwargs_np={ - "data": x, - }, - method_input_dtypes=[input_dtype1, input_dtype2], - method_all_as_kwargs_np={ - "y": y, - "upper": np.array_equal(y, np.triu(y)), - }, - frontend_method_data=frontend_method_data, - init_flags=init_flags, - method_flags=method_flags, - frontend=frontend, - on_device=on_device, - rtol_=1e-3, - atol_=1e-3, - ) - - # tile @handle_frontend_method( class_tree=CLASS_TREE,