From 34b14b32b03bcafd2d7d85bf40fe49975ecca9bb Mon Sep 17 00:00:00 2001 From: Jay Choy <91728831+ZJay07@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:27:14 +0000 Subject: [PATCH 1/4] fixed tensor.fix --- ivy/functional/frontends/torch/tensor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py index 3d4908750356a..60288895b848c 100644 --- a/ivy/functional/frontends/torch/tensor.py +++ b/ivy/functional/frontends/torch/tensor.py @@ -1182,7 +1182,9 @@ def trunc_(self): self.ivy_array = self.trunc().ivy_array return self - @with_unsupported_dtypes({"2.2 and below": ("float16", "complex")}, "torch") + @with_supported_dtypes( + {"2.2 and below": ("int32", "int64", "float64", "float32")}, "torch" + ) def fix(self): return torch_frontend.fix(self) From aeb4d96a041a31ff86751ca1a1e8d1ed04de7a6a Mon Sep 17 00:00:00 2001 From: Jay Choy <91728831+ZJay07@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:39:58 +0000 Subject: [PATCH 2/4] fixed paddle specific --- ivy/functional/frontends/torch/tensor.py | 4 +--- .../test_ivy/test_frontends/test_torch/test_tensor.py | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py index 60288895b848c..3d4908750356a 100644 --- a/ivy/functional/frontends/torch/tensor.py +++ b/ivy/functional/frontends/torch/tensor.py @@ -1182,9 +1182,7 @@ def trunc_(self): self.ivy_array = self.trunc().ivy_array return self - @with_supported_dtypes( - {"2.2 and below": ("int32", "int64", "float64", "float32")}, "torch" - ) + @with_unsupported_dtypes({"2.2 and below": ("float16", "complex")}, "torch") def fix(self): return torch_frontend.fix(self) diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py index fff739b50489d..68f6144f3a9af 100644 --- a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py +++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py @@ -6802,6 +6802,13 @@ def test_torch_fix( backend_fw, ): input_dtype, x = dtype_value + if backend_fw == "paddle" and input_dtype not in [ + "int32", + "int64", + "float64", + "float32", + ]: + return helpers.test_frontend_method( init_input_dtypes=input_dtype, backend_to_test=backend_fw, From 671f1c1ca1cd3d77341d0750601906e37d632cf5 Mon Sep 17 00:00:00 2001 From: Jay Choy <91728831+ZJay07@users.noreply.github.com> Date: Sat, 23 Mar 2024 18:11:45 +0000 Subject: [PATCH 3/4] proper fix --- .../backends/paddle/experimental/elementwise.py | 4 +++- .../test_frontends/test_torch/test_tensor.py | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ivy/functional/backends/paddle/experimental/elementwise.py b/ivy/functional/backends/paddle/experimental/elementwise.py index c26898376ea69..3fa2dd56d778d 100644 --- a/ivy/functional/backends/paddle/experimental/elementwise.py +++ b/ivy/functional/backends/paddle/experimental/elementwise.py @@ -272,7 +272,9 @@ def allclose( return paddle.allclose(x1, x2, rtol=rtol, atol=atol, equal_nan=equal_nan).squeeze(0) -@with_unsupported_dtypes({"2.6.0 and below": ("float16",)}, backend_version) +@with_supported_dtypes( + {"2.6.0 and below": ("int32", "int64", "float64", "float32")}, backend_version +) def fix( x: paddle.Tensor, /, diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py index 68f6144f3a9af..688f6a26ba572 100644 --- a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py +++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py @@ -6802,13 +6802,13 @@ def test_torch_fix( backend_fw, ): input_dtype, x = dtype_value - if backend_fw == "paddle" and input_dtype not in [ - "int32", - "int64", - "float64", - "float32", - ]: - return + # if backend_fw == "paddle" and input_dtype not in [ + # "int32", + # "int64", + # "float64", + # "float32", + # ]: + # return helpers.test_frontend_method( init_input_dtypes=input_dtype, backend_to_test=backend_fw, From b333fcd96095de1748250603a8b040c41297e6c2 Mon Sep 17 00:00:00 2001 From: Jay Choy <91728831+ZJay07@users.noreply.github.com> Date: Mon, 25 Mar 2024 13:08:06 +0000 Subject: [PATCH 4/4] removed commented code --- .../test_ivy/test_frontends/test_torch/test_tensor.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py index 688f6a26ba572..fff739b50489d 100644 --- a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py +++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py @@ -6802,13 +6802,6 @@ def test_torch_fix( backend_fw, ): input_dtype, x = dtype_value - # if backend_fw == "paddle" and input_dtype not in [ - # "int32", - # "int64", - # "float64", - # "float32", - # ]: - # return helpers.test_frontend_method( init_input_dtypes=input_dtype, backend_to_test=backend_fw,