internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ivy-llc/ivy

Issue:
trace



Discussion:
#18013
Currently working on this.
Still working on this :)

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/ndarray/ndarray.py b/ivy/functional/frontends/numpy/ndarray/ndarray.py
--- a/ivy/functional/frontends/numpy/ndarray/ndarray.py
+++ b/ivy/functional/frontends/numpy/ndarray/ndarray.py
@@ -6,6 +6,9 @@
 import ivy
 import ivy.functional.frontends.numpy as np_frontend
 from ivy.functional.frontends.numpy.func_wrapper import _to_ivy_array
+from ivy.func_wrapper import (
+    with_supported_device_and_dtypes,
+)
 
 
 # --- Classes ---#
@@ -410,6 +413,31 @@ def tofile(self, fid, /, sep="", format_="%s"):
     def tolist(self) -> list:
         return self._ivy_array.to_list()
 
+    @with_supported_device_and_dtypes(
+        {
+            "1.26.2 and below": {
+                "cpu": (
+                    "int64",
+                    "float32",
+                    "float64",
+                    "bfloat16",
+                    "complex64",
+                    "complex128",
+                    "uint64",
+                )
+            }
+        },
+        "numpy",
+    )
+    def trace(self, *, offset=0, axis1=0, axis2=1, out=None):
+        return np_frontend.trace(
+            self,
+            offset=offset,
+            axis1=axis1,
+            axis2=axis2,
+            out=out,
+        )
+
     def view(self):
         return np_frontend.reshape(self, tuple(self.shape))
 


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_ndarray/test_ndarray.py
@@ -3711,6 +3711,53 @@ def test_numpy_tolist(
     )
 
 
+# trace
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="numpy.array",
+    method_name="trace",
+    dtype_x_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        min_num_dims=2,
+        min_axes_size=2,
+        max_axes_size=2,
+        valid_axis=True,
+    ),
+    offset=st.integers(min_value=-2, max_value=2),
+)
+def test_numpy_trace(
+    dtype_x_axis,
+    offset,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    backend_fw,
+    frontend,
+    on_device,
+):
+    input_dtypes, x, axis = dtype_x_axis
+
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtypes,
+        backend_to_test=backend_fw,
+        init_all_as_kwargs_np={
+            "object": x[0],
+        },
+        method_input_dtypes=input_dtypes,
+        method_all_as_kwargs_np={
+            "axis1": axis[0],
+            "axis2": axis[1],
+            "offset": offset,
+            "out": None,
+        },
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )
+
+
 @handle_frontend_method(
     class_tree=CLASS_TREE,
     init_tree="numpy.array",
Repository: ivy-llc/ivy

Issue:
`Exception` statements with no effect
In few places I found that an `exception` is created but it is not `raised` or `returned` for subsequent use elsewhere.
Like in the following cases:
https://github.com/unifyai/ivy/blob/3260ec4308298bed5149e5abd92add5bf923a0f1/ivy/functional/backends/torch/elementwise.py#L650
https://github.com/unifyai/ivy/blob/3260ec4308298bed5149e5abd92add5bf923a0f1/ivy/functional/frontends/tensorflow/ragged/ragged.py#L28
https://github.com/unifyai/ivy/blob/3260ec4308298bed5149e5abd92add5bf923a0f1/ivy/functional/frontends/tensorflow/ragged/ragged.py#L33
https://github.com/unifyai/ivy/blob/3260ec4308298bed5149e5abd92add5bf923a0f1/ivy/functional/frontends/tensorflow/ragged/ragged.py#L52
I think at all these places the exceptions should be `raised`.


Discussion:

Resolving patch:
diff --git a/ivy/functional/backends/torch/elementwise.py b/ivy/functional/backends/torch/elementwise.py
--- a/ivy/functional/backends/torch/elementwise.py
+++ b/ivy/functional/backends/torch/elementwise.py
@@ -647,7 +647,7 @@ def trapz(
         return torch.trapezoid(y, dx=dx, dim=axis)
     else:
         if dx is not None:
-            TypeError(
+            raise TypeError(
                 "trapezoid() received an invalid combination of arguments - got "
                 "(Tensor, Tensor, int), but expected one of: *(Tensor "
                 "y, Tensor x, *, int dim) * (Tensor y, *, Number dx, int dim)"
diff --git a/ivy/functional/frontends/tensorflow/ragged/ragged.py b/ivy/functional/frontends/tensorflow/ragged/ragged.py
--- a/ivy/functional/frontends/tensorflow/ragged/ragged.py
+++ b/ivy/functional/frontends/tensorflow/ragged/ragged.py
@@ -25,12 +25,12 @@ def from_row_splits(cls, values, row_splits, name=None, validate=True):
 
         if values.shape[0] != row_splits[-1] or row_splits[0] != 0:
             if values.shape[0] != row_splits[-1]:
-                ivy.utils.exceptions.IvyException(
+                raise ivy.utils.exceptions.IvyException(
                     "first dimension of shape of values should be equal to the"
                     " last dimension of row_splits"
                 )
             else:
-                ivy.utils.exceptions.IvyException(
+                raise ivy.utils.exceptions.IvyException(
                     "first value of row_splits should be equal to zero."
                 )
         data = [
@@ -49,7 +49,7 @@ def from_row_lengths(
     ):
         # TODO : modify this, if necessary, to accept raggedTensor inputs too
         if sum(row_lengths) != values.shape[0]:
-            ivy.utils.exceptions.IvyException(
+            raise ivy.utils.exceptions.IvyException(
                 "first dimension of values should be equal to sum(row_lengths) "
             )
         data = []


Test patch:
Repository: ivy-llc/ivy

Issue:
fft2
Paddle-Paddle frontend implementation for the fft2 function.


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/fft.py b/ivy/functional/frontends/paddle/fft.py
--- a/ivy/functional/frontends/paddle/fft.py
+++ b/ivy/functional/frontends/paddle/fft.py
@@ -16,6 +16,25 @@ def fft(x, n=None, axis=-1.0, norm="backward", name=None):
     return ivy.astype(ret, x.dtype)
 
 
+@with_supported_dtypes(
+    {
+        "2.5.2 and below": (
+            "int32",
+            "int64",
+            "float32",
+            "float64",
+        )
+    },
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def fft2(x, s=None, axes=(-2, -1), norm="backward", name=None):
+    if axes is None:
+        axes = (-2, -1)
+    ret = ivy.fft2(x, s=s, dim=axes, norm=norm)
+    return ret
+
+
 @with_supported_dtypes(
     {
         "2.5.2 and below": (


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_fft.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_fft.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_fft.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_fft.py
@@ -54,6 +54,54 @@ def test_paddle_fft(
     )
 
 
+@handle_frontend_test(
+    fn_tree="paddle.fft.fft2",
+    dtypes_x_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_value=-10,
+        max_value=10,
+        min_num_dims=2,
+        min_dim_size=2,
+        valid_axis=True,
+        force_int_axis=True,
+    ),
+    s=st.one_of(
+        st.none(),
+        st.lists(st.integers(min_value=2, max_value=10), min_size=2, max_size=2),
+    ),
+    axes=st.one_of(
+        st.none(),
+        st.tuples(
+            st.integers(min_value=-2, max_value=2),
+            st.integers(min_value=-1, max_value=2),
+        ),
+    ),
+    norm=st.sampled_from(["backward", "ortho", "forward"]),
+)
+def test_paddle_fft2(
+    dtypes_x_axis,
+    s,
+    axes,
+    norm,
+    frontend,
+    backend_fw,
+    test_flags,
+    fn_tree,
+):
+    input_dtypes, x, _ = dtypes_x_axis
+    helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        x=x[0],
+        s=s,
+        axes=axes,
+        norm=norm,
+    )
+
+
 @handle_frontend_test(
     fn_tree="paddle.fft.fftfreq",
     n=st.integers(min_value=1, max_value=1000),
Repository: ivy-llc/ivy

Issue:
`key-word` arguments passed as `positional` arguments in function calls
In the following function calls, some of the arguments are passed as positional arguments but from the function definition they should be passed as key-word arguments.
https://github.com/unifyai/ivy/blob/af8db63c36d85c9c02db73bbc3b02ef09b15f29a/ivy/functional/frontends/jax/numpy/statistical.py#L498
https://github.com/unifyai/ivy/blob/af8db63c36d85c9c02db73bbc3b02ef09b15f29a/ivy/functional/ivy/experimental/statistical.py#L207-L215
https://github.com/unifyai/ivy/blob/af8db63c36d85c9c02db73bbc3b02ef09b15f29a/ivy/functional/backends/torch/layers.py#L529
https://github.com/unifyai/ivy/blob/af8db63c36d85c9c02db73bbc3b02ef09b15f29a/ivy/functional/ivy/manipulation.py#L683-L690
At both the places `axis` should be the key-word argument.


Discussion:

Resolving patch:
diff --git a/ivy/functional/backends/torch/layers.py b/ivy/functional/backends/torch/layers.py
--- a/ivy/functional/backends/torch/layers.py
+++ b/ivy/functional/backends/torch/layers.py
@@ -526,7 +526,7 @@ def depthwise_conv2d(
     dilations = [dilations] * 2 if isinstance(dilations, int) else dilations
     if data_format == "NHWC":
         x = x.permute(0, 3, 1, 2)
-    filters = ivy.squeeze(filters, 3).to_native() if filters.ndim == 4 else filters
+    filters = ivy.squeeze(filters, axis=3).to_native() if filters.ndim == 4 else filters
     filters = torch.unsqueeze(filters, -1)
     dims_in = filters.shape[-2]
     filters = filters.permute(2, 3, 0, 1)
diff --git a/ivy/functional/frontends/jax/numpy/statistical.py b/ivy/functional/frontends/jax/numpy/statistical.py
--- a/ivy/functional/frontends/jax/numpy/statistical.py
+++ b/ivy/functional/frontends/jax/numpy/statistical.py
@@ -495,7 +495,7 @@ def _nanquantile_unchecked(
     ):
         """Assumes that q is in [0, 1], and is an ndarray."""
         if a.size == 0:
-            return ivy.nanmean(a, axis, out=out, keepdims=keepdims)
+            return ivy.nanmean(a, axis=axis, out=out, keepdims=keepdims)
         return _ureduce(
             a,
             func=_nanquantile_ureduce_func,


Test patch:
Repository: ivy-llc/ivy

Issue:
 __radd__



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py
--- a/ivy/functional/frontends/paddle/tensor/tensor.py
+++ b/ivy/functional/frontends/paddle/tensor/tensor.py
@@ -68,6 +68,13 @@ def ivy_array(self, array):
     def __add__(self, y, /, name=None):
         return paddle_frontend.add(self, y)
 
+    @with_unsupported_dtypes(
+        {"2.5.2 and below": ("bool", "unsigned", "int8", "float16", "bfloat16")},
+        "paddle",
+    )
+    def __radd__(self, x, /, name=None):
+        return paddle_frontend.add(self, x)
+
     @with_unsupported_dtypes(
         {"2.5.2 and below": ("bool", "unsigned", "int8", "float16", "bfloat16")},
         "paddle",


Test patch:
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
--- 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
@@ -492,6 +492,43 @@ def test_paddle___or__(
     )
 
 
+# __radd__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__radd__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"), num_arrays=2, shared_dtype=True
+    ),
+)
+def test_paddle___radd__(
+    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={
+            "x": x[1],
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # __setitem__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
__sub__



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py
--- a/ivy/functional/frontends/paddle/tensor/tensor.py
+++ b/ivy/functional/frontends/paddle/tensor/tensor.py
@@ -68,6 +68,13 @@ def ivy_array(self, array):
     def __add__(self, y, /, name=None):
         return paddle_frontend.add(self, y)
 
+    @with_unsupported_dtypes(
+        {"2.5.2 and below": ("bool", "unsigned", "int8", "float16", "bfloat16")},
+        "paddle",
+    )
+    def __sub__(self, y, /, name=None):
+        return paddle_frontend.subtract(self, y)
+
     @with_unsupported_dtypes(
         {"2.5.2 and below": ("uint8", "int8", "int16", "float16", "bfloat16")},
         "paddle",


Test patch:
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
--- 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
@@ -525,6 +525,43 @@ def test_paddle___setitem__(
     )
 
 
+# __sub__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__sub__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"), num_arrays=2, shared_dtype=True
+    ),
+)
+def test_paddle___sub__(
+    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={
+            "y": x[1],
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # __getitem__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
__mul__



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py
--- a/ivy/functional/frontends/paddle/tensor/tensor.py
+++ b/ivy/functional/frontends/paddle/tensor/tensor.py
@@ -68,6 +68,13 @@ def ivy_array(self, array):
     def __add__(self, y, /, name=None):
         return paddle_frontend.add(self, y)
 
+    @with_unsupported_dtypes(
+        {"2.5.2 and below": ("uint8", "int8", "int16", "float16", "bfloat16")},
+        "paddle",
+    )
+    def __mul__(self, y, /, name=None):
+        return paddle_frontend.multiply(self, y)
+
     @with_unsupported_dtypes(
         {
             "2.5.2 and below": (


Test patch:
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
--- 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
@@ -418,6 +418,43 @@ def test_paddle___le__(
     )
 
 
+# __mul__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__mul__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"), num_arrays=2, shared_dtype=True
+    ),
+)
+def test_paddle___mul__(
+    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={
+            "y": x[1],
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # __or__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
__gt__



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py
--- a/ivy/functional/frontends/paddle/tensor/tensor.py
+++ b/ivy/functional/frontends/paddle/tensor/tensor.py
@@ -68,6 +68,22 @@ def ivy_array(self, array):
     def __add__(self, y, /, name=None):
         return paddle_frontend.add(self, y)
 
+    @with_unsupported_dtypes(
+        {
+            "2.5.2 and below": (
+                "bool",
+                "uint8",
+                "int8",
+                "int16",
+                "complex64",
+                "complex128",
+            )
+        },
+        "paddle",
+    )
+    def __gt__(self, y, /, name=None):
+        return paddle_frontend.logic.greater_than(self, y)
+
     @with_unsupported_dtypes(
         {
             "2.5.2 and below": (


Test patch:
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
--- 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
@@ -344,6 +344,43 @@ def test_paddle___ge__(
     )
 
 
+# __gt__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__gt__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"), num_arrays=2, shared_dtype=True
+    ),
+)
+def test_paddle___gt__(
+    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={
+            "y": x[1],
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # __le__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
__ge__



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py
--- a/ivy/functional/frontends/paddle/tensor/tensor.py
+++ b/ivy/functional/frontends/paddle/tensor/tensor.py
@@ -68,6 +68,22 @@ def ivy_array(self, array):
     def __add__(self, y, /, name=None):
         return paddle_frontend.add(self, y)
 
+    @with_unsupported_dtypes(
+        {
+            "2.5.2 and below": (
+                "bool",
+                "uint8",
+                "int8",
+                "int16",
+                "complex64",
+                "complex128",
+            )
+        },
+        "paddle",
+    )
+    def __ge__(self, y, /, name=None):
+        return paddle_frontend.logic.greater_equal(self, y)
+
     @with_unsupported_dtypes(
         {
             "2.5.2 and below": (


Test patch:
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
--- 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
@@ -307,6 +307,43 @@ def test_paddle___add__(
     )
 
 
+# __ge__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__ge__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"), num_arrays=2, shared_dtype=True
+    ),
+)
+def test_paddle___ge__(
+    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={
+            "y": x[1],
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # __le__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
__le__



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/tensor.py b/ivy/functional/frontends/paddle/tensor/tensor.py
--- a/ivy/functional/frontends/paddle/tensor/tensor.py
+++ b/ivy/functional/frontends/paddle/tensor/tensor.py
@@ -68,6 +68,22 @@ def ivy_array(self, array):
     def __add__(self, y, /, name=None):
         return paddle_frontend.add(self, y)
 
+    @with_unsupported_dtypes(
+        {
+            "2.5.2 and below": (
+                "bool",
+                "uint8",
+                "int8",
+                "int16",
+                "complex64",
+                "complex128",
+            )
+        },
+        "paddle",
+    )
+    def __le__(self, y, /, name=None):
+        return paddle_frontend.logic.less_equal(self, y)
+
     @with_supported_dtypes(
         {
             "2.5.2 and below": (


Test patch:
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
--- 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
@@ -307,6 +307,43 @@ def test_paddle___add__(
     )
 
 
+# __le__
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__le__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"), num_arrays=2, shared_dtype=True
+    ),
+)
+def test_paddle___le__(
+    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={
+            "y": x[1],
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 # __or__
 @handle_frontend_method(
     class_tree=CLASS_TREE,