From b1bd009d16e28d0850f5dfad6825a8012896f558 Mon Sep 17 00:00:00 2001 From: roudik Date: Mon, 4 Sep 2023 08:59:27 +0400 Subject: [PATCH 1/4] logical_xor --- ivy/functional/frontends/torch/tensor.py | 4 +++ .../test_frontends/test_torch/test_tensor.py | 36 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py index 13a056436f6a7..cfec584ca87d2 100644 --- a/ivy/functional/frontends/torch/tensor.py +++ b/ivy/functional/frontends/torch/tensor.py @@ -437,6 +437,10 @@ def logical_not_(self): def logical_or(self, other): return torch_frontend.logical_or(self, other) + @with_unsupported_dtypes({"2.0.1 and below": ("bfloat16",)}, "torch") + def logical_xor(self, other): + return torch_frontend.logical_xor(self, other) + def bitwise_not(self): return torch_frontend.bitwise_not(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 76053d9758076..e76ccb0470091 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 @@ -8522,6 +8522,42 @@ def test_torch_tensor_logical_or( on_device=on_device, ) +# logical_xor +@handle_frontend_method( + class_tree=CLASS_TREE, + init_tree="torch.tensor", + method_name="logical_xor", + dtype_and_x=helpers.dtype_and_values( + available_dtypes=helpers.get_dtypes("valid"), + num_arrays=2, + ), +) +def test_torch_tensor_logical_xor( + dtype_and_x, + frontend_method_data, + init_flags, + method_flags, + frontend, + on_device, + backend_fw, +): + input_dtype, x = dtype_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={ + "other": x[1], + }, + frontend_method_data=frontend_method_data, + init_flags=init_flags, + method_flags=method_flags, + frontend=frontend, + on_device=on_device, + ) # long @handle_frontend_method( From 58745d9ab3e018acb9525af2b318ca81e6771bd9 Mon Sep 17 00:00:00 2001 From: ivy-branch Date: Sat, 9 Sep 2023 19:06:16 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A4=96=20Lint=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py | 2 ++ 1 file changed, 2 insertions(+) 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 e76ccb0470091..5af0e1f5a03a0 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 @@ -8522,6 +8522,7 @@ def test_torch_tensor_logical_or( on_device=on_device, ) + # logical_xor @handle_frontend_method( class_tree=CLASS_TREE, @@ -8559,6 +8560,7 @@ def test_torch_tensor_logical_xor( on_device=on_device, ) + # long @handle_frontend_method( class_tree=CLASS_TREE, From 960fab3d56291a5d266720d4cd8816367e8ae557 Mon Sep 17 00:00:00 2001 From: roudik Date: Wed, 13 Sep 2023 19:41:08 +0400 Subject: [PATCH 3/4] logical_xor --- ivy/functional/frontends/torch/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py index cfec584ca87d2..750ed44282893 100644 --- a/ivy/functional/frontends/torch/tensor.py +++ b/ivy/functional/frontends/torch/tensor.py @@ -437,7 +437,7 @@ def logical_not_(self): def logical_or(self, other): return torch_frontend.logical_or(self, other) - @with_unsupported_dtypes({"2.0.1 and below": ("bfloat16",)}, "torch") + @with_unsupported_dtypes({"2.0.1 and below": ("bfloat16", "uint16")}, "torch") def logical_xor(self, other): return torch_frontend.logical_xor(self, other) From 4b0d4e1c5f2942533eceb1551893e01ba21f79c0 Mon Sep 17 00:00:00 2001 From: roudik Date: Wed, 13 Sep 2023 20:52:11 +0400 Subject: [PATCH 4/4] Revert "logical_xor" This reverts commit 960fab3d56291a5d266720d4cd8816367e8ae557. --- ivy/functional/frontends/torch/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py index 750ed44282893..cfec584ca87d2 100644 --- a/ivy/functional/frontends/torch/tensor.py +++ b/ivy/functional/frontends/torch/tensor.py @@ -437,7 +437,7 @@ def logical_not_(self): def logical_or(self, other): return torch_frontend.logical_or(self, other) - @with_unsupported_dtypes({"2.0.1 and below": ("bfloat16", "uint16")}, "torch") + @with_unsupported_dtypes({"2.0.1 and below": ("bfloat16",)}, "torch") def logical_xor(self, other): return torch_frontend.logical_xor(self, other)