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

Issue:
batch_matmul



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/lax/operators.py b/ivy/functional/frontends/jax/lax/operators.py
--- a/ivy/functional/frontends/jax/lax/operators.py
+++ b/ivy/functional/frontends/jax/lax/operators.py
@@ -277,6 +277,23 @@ def dot(lhs, rhs, precision=None, preferred_element_type=None):
     return ret
 
 
+@to_ivy_arrays_and_back
+def batch_matmul(lhs, rhs, precision=None):
+    if lhs.ndim < 2 or rhs.ndim < 2:
+        raise ValueError(
+            "Arguments to batch_matmul must be at least 2D, got {}, {}".format(
+                lhs.ndim, rhs.ndim
+            )
+        )
+    if lhs.ndim != rhs.ndim:
+        raise ValueError(
+            "Arguments to batch_matmul must have same ndim, got {}, {}".format(
+                lhs.ndim, rhs.ndim
+            )
+        )
+    return ivy.matmul(lhs, rhs).astype(lhs.dtype)
+
+
 @with_unsupported_dtypes({"0.4.5 and below": ("bool",)}, "jax")
 @to_ivy_arrays_and_back
 def dot_general(


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_lax_operators.py
@@ -1743,6 +1743,60 @@ def test_jax_lax_dot(
     )
 
 
+@st.composite
+def _get_dtype_inputs_for_batch_matmul(draw):
+    dtype, lhs = draw(
+        helpers.dtype_and_values(
+            min_num_dims=2,
+            max_num_dims=6,
+            min_value=2,
+            max_value=5,
+        )
+    )
+    lhs_shape = lhs[0].shape
+    rhs_shape = list(lhs_shape)
+    rhs_shape[-1], rhs_shape[-2] = rhs_shape[-2], rhs_shape[-1]
+    rhs_shape = tuple(rhs_shape)
+    rhs = draw(
+        helpers.array_values(
+            dtype=dtype[0],
+            shape=rhs_shape,
+            min_value=2,
+            max_value=5,
+        )
+    )
+
+    return dtype, lhs[0], rhs
+
+
+@handle_frontend_test(
+    fn_tree="jax.lax.batch_matmul",
+    dtypes_and_xs=_get_dtype_inputs_for_batch_matmul(),
+    test_with_out=st.just(False),
+)
+def test_jax_lax_batch_matmul(
+    *,
+    dtypes_and_xs,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtypes, lhs, rhs = dtypes_and_xs
+    helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        rtol=1e-2,
+        atol=1e-2,
+        lhs=lhs,
+        rhs=rhs,
+        precision=None,
+    )
+
+
 @st.composite
 def _general_dot_helper(draw):
     input_dtype, lhs, lshape = draw(
Repository: ivy-llc/ivy

Issue:
sort



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
@@ -171,3 +171,7 @@ def cholesky(self, upper=False, name=None):
     @with_supported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
     def all(self, axis=None, keepdim=False, dtype=None, name=None):
         return ivy.all(self.ivy_array, axis=axis, keepdims=keepdim, dtype=dtype)
+    
+    @with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
+    def sort(self, axis=-1, descending=False, name=None):
+        return ivy.sort(self._ivy_array, axis=axis, descending=descending)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
@@ -844,6 +844,7 @@ def test_paddle_cholesky(
         on_device=on_device,
     )
 
+
 # all
 @handle_frontend_method(
     class_tree=CLASS_TREE,
@@ -884,3 +885,45 @@ def test_paddle_all(
         method_flags=method_flags,
         on_device=on_device,
     )
+
+
+#sort
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="sort",
+    dtype_x_axis=helpers.dtype_values_axis(
+        available_dtypes=st.one_of(helpers.get_dtypes("float")),
+        min_axis=-1,
+        max_axis=0,
+        min_num_dims=1,
+        force_int_axis=True,
+    ),
+    descending=st.booleans(),
+)
+def test_paddle_sort(
+    dtype_x_axis,
+    descending,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtypes, x, axis = dtype_x_axis
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtypes,
+        init_all_as_kwargs_np={
+            "object": x[0],
+        },
+        method_input_dtypes=input_dtypes,
+        method_all_as_kwargs_np={
+            "axis": axis,
+            "descending": descending,
+        },
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
 torch.Tensor.diag



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py
--- a/ivy/functional/frontends/torch/tensor.py
+++ b/ivy/functional/frontends/torch/tensor.py
@@ -1314,6 +1314,9 @@ def floor_(self, *, out=None):
         self.ivy_array = self.floor().ivy_array
         return self
 
+    def diag(self, diagonal=0):
+        return torch_frontend.diag(self, diagonal=diagonal)
+
 
 class Size(tuple):
     def __new__(cls, iterable=()):


Test patch:
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
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
@@ -9241,3 +9241,40 @@ def test_torch_instance_floor_(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="diag",
+    dtype_and_values=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        shape=st.shared(helpers.get_shape(min_num_dims=1, max_num_dims=2), key="shape"),
+    ),
+    diagonal=st.integers(min_value=-100, max_value=100),
+)
+def test_torch_instance_diag(
+    dtype_and_values,
+    diagonal,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, values = dtype_and_values
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        init_all_as_kwargs_np={
+            "data": values[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={
+            "diagonal": diagonal,
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
Fix the torch.Tensor.floor_ signature
The `torch.Tensor.floor_` signature is wrong.

At the moment is `def floor_(self, *, out=None):`

It should be `def floor_(self):`


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/tensor.py b/ivy/functional/frontends/torch/tensor.py
--- a/ivy/functional/frontends/torch/tensor.py
+++ b/ivy/functional/frontends/torch/tensor.py
@@ -1310,7 +1310,7 @@ def baddbmm(self, batch1, batch2, *, beta=1, alpha=1):
         )
 
     @with_unsupported_dtypes({"2.0.1 and below": ("float16",)}, "torch")
-    def floor_(self, *, out=None):
+    def floor_(self):
         self.ivy_array = self.floor().ivy_array
         return self
 


Test patch:
Repository: ivy-llc/ivy

Issue:
exp



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/math.py b/ivy/functional/frontends/paddle/tensor/math.py
--- a/ivy/functional/frontends/paddle/tensor/math.py
+++ b/ivy/functional/frontends/paddle/tensor/math.py
@@ -162,3 +162,9 @@ def rad2deg(x, name=None):
 @to_ivy_arrays_and_back
 def tan(x, name=None):
     return ivy.tan(x)
+
+
+@with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
+@to_ivy_arrays_and_back
+def exp(x, name=None):
+    return ivy.exp(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
@@ -722,3 +722,29 @@ def test_paddle_tan(
         atol=1e-2,
         x=x[0],
     )
+
+
+# exp
+@handle_frontend_test(
+    fn_tree="paddle.exp",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_exp(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+    )
Repository: ivy-llc/ivy

Issue:
solve



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/linalg.py b/ivy/functional/frontends/paddle/tensor/linalg.py
--- a/ivy/functional/frontends/paddle/tensor/linalg.py
+++ b/ivy/functional/frontends/paddle/tensor/linalg.py
@@ -115,6 +115,13 @@ def pinv(x, rcond=1e-15, hermitian=False, name=None):
     return ivy.pinv(x, rtol=rcond)
 
 
+# solve
+@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
+@to_ivy_arrays_and_back
+def solve(x1, x2, name=None):
+    return ivy.solve(x1, x2)
+
+
 # cholesky
 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
 @to_ivy_arrays_and_back


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_linalg.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_linalg.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_linalg.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_linalg.py
@@ -475,6 +475,39 @@ def test_paddle_pinv(
     )
 
 
+# solve
+@handle_frontend_test(
+    fn_tree="paddle.solve",
+    dtype_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+        shared_dtype=True,
+        min_value=-10,
+        max_value=10,
+    ),
+    aliases=["paddle.tensor.linalg.solve"],
+    test_with_out=st.just(False),
+)
+def test_paddle_solve(
+    *,
+    dtype_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+):
+    input_dtype, x = dtype_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+        y=x[1],
+    )
+
+
 # cholesky
 @handle_frontend_test(
     fn_tree="paddle.tensor.linalg.cholesky",
Repository: ivy-llc/ivy

Issue:
ifftn



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py b/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py
--- a/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py
+++ b/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py
@@ -125,3 +125,12 @@ def rfftfreq(n, d=1.0):
     N = n // 2 + 1
     results = ivy.arange(0, N, dtype=int)
     return results * val
+
+
+@with_unsupported_dtypes({"1.24.3 and below": ("float16",)}, "numpy")
+@to_ivy_arrays_and_back
+def ifftn(a, s=None, axes=None, norm=None):
+    a = ivy.asarray(a, dtype=ivy.complex128)
+    a = ivy.ifftn(a, s=s, axes=axes, norm=norm)
+    return a
+


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_fft/test_discrete_fourier_transform.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_fft/test_discrete_fourier_transform.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_fft/test_discrete_fourier_transform.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_fft/test_discrete_fourier_transform.py
@@ -192,3 +192,23 @@ def test_numpy_rfftfreq(n, sample_rate, frontend, test_flags, fn_tree, on_device
         n=n,
         d=d,
     )
+
+
+@handle_frontend_test(
+    fn_tree="numpy.fft.ifftn",
+    dtype_and_x=x_and_ifft(),
+)
+def test_numpy_ifftn(dtype_and_x, frontend, test_flags, fn_tree, on_device):
+    input_dtype, x, dim, norm, n = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        test_values=True,
+        a=x,
+        s=None,
+        axes=None,
+        norm=norm,
+    )
Repository: ivy-llc/ivy

Issue:
 isnan
adding  isnan in paddle.tensor.tesnor.tesnor from issue #15115


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
@@ -293,6 +293,13 @@ def bitwise_or(self, y, out=None, name=None):
     def logical_xor(self, y, out=None, name=None):
         return paddle_frontend.logical_xor(self, y, out=out)
 
+    @with_supported_dtypes(
+        {"2.5.0 and below": ("float16", "float32", "float64", "int32", "int64")},
+        "paddle",
+    )
+    def isnan(self, name=None):
+        return paddle_frontend.isnan(self)
+
     @with_unsupported_dtypes(
         {
             "2.5.0 and below": (


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
@@ -2152,3 +2152,36 @@ def test_paddle_instance_floor_(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+# isnan
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="isnan",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+    ),
+)
+def test_paddle_isnan(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        init_all_as_kwargs_np={
+            "data": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={},
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
is_floating_point



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/attribute.py b/ivy/functional/frontends/paddle/tensor/attribute.py
--- a/ivy/functional/frontends/paddle/tensor/attribute.py
+++ b/ivy/functional/frontends/paddle/tensor/attribute.py
@@ -8,3 +8,8 @@
 @to_ivy_arrays_and_back
 def is_complex(x):
     return ivy.is_complex_dtype(x)
+
+
+@to_ivy_arrays_and_back
+def is_floating_point(x):
+    return ivy.is_float_dtype(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
@@ -28,3 +28,28 @@ def test_paddle_is_complex(
         on_device=on_device,
         x=input[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.tensor.attribute.is_floating_point",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_is_floating_point(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, input = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=input[0],
+    )
Repository: ivy-llc/ivy

Issue:
is_integer



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/attribute.py b/ivy/functional/frontends/paddle/tensor/attribute.py
--- a/ivy/functional/frontends/paddle/tensor/attribute.py
+++ b/ivy/functional/frontends/paddle/tensor/attribute.py
@@ -10,6 +10,11 @@ def is_complex(x):
     return ivy.is_complex_dtype(x)
 
 
+@to_ivy_arrays_and_back
+def is_integer(x):
+    return ivy.is_int_dtype(x)
+
+
 @to_ivy_arrays_and_back
 def is_floating_point(x):
     return ivy.is_float_dtype(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
@@ -30,6 +30,31 @@ def test_paddle_is_complex(
     )
 
 
+@handle_frontend_test(
+    fn_tree="paddle.tensor.attribute.is_integer",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_is_integer(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, input = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=input[0],
+    )
+
+
 @handle_frontend_test(
     fn_tree="paddle.tensor.attribute.is_floating_point",
     dtype_and_x=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
real



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/attribute.py b/ivy/functional/frontends/paddle/tensor/attribute.py
--- a/ivy/functional/frontends/paddle/tensor/attribute.py
+++ b/ivy/functional/frontends/paddle/tensor/attribute.py
@@ -18,3 +18,8 @@ def is_integer(x):
 @to_ivy_arrays_and_back
 def is_floating_point(x):
     return ivy.is_float_dtype(x)
+
+
+@to_ivy_arrays_and_back
+def real(x):
+    return ivy.real(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
@@ -78,3 +78,28 @@ def test_paddle_is_floating_point(
         on_device=on_device,
         x=input[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.tensor.attribute.real",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_real(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, input = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=input[0],
+    )
Repository: ivy-llc/ivy

Issue:
imag



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/attribute.py b/ivy/functional/frontends/paddle/tensor/attribute.py
--- a/ivy/functional/frontends/paddle/tensor/attribute.py
+++ b/ivy/functional/frontends/paddle/tensor/attribute.py
@@ -23,3 +23,8 @@ def is_floating_point(x):
 @to_ivy_arrays_and_back
 def real(x):
     return ivy.real(x)
+
+
+@to_ivy_arrays_and_back
+def imag(x):
+    return ivy.imag(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_attribute.py
@@ -103,3 +103,28 @@ def test_paddle_real(
         on_device=on_device,
         x=input[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.tensor.attribute.imag",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_imag(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, input = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=input[0],
+    )