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

Issue:
__rdiv__



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
@@ -207,6 +207,13 @@ def __len__(self):
     def __neg__(self):
         return paddle_frontend.neg(self)
 
+    @with_unsupported_dtypes(
+        {"2.5.2 and below": ("bool", "unsigned", "int8", "float16", "bfloat16")},
+        "paddle",
+    )
+    def __rdiv__(self, y, /, name=None):
+        return paddle_frontend.divide(y, self)
+
     # Instance Methods #
     # ---------------- #
 


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
@@ -871,6 +871,49 @@ def test_paddle__neg__(
     )
 
 
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__rdiv__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        num_arrays=2,
+        shared_dtype=True,
+        large_abs_safety_factor=10,
+        small_abs_safety_factor=10,
+        safety_factor_scale="log",
+    ),
+)
+def test_paddle__rdiv__(
+    dtype_and_x,
+    frontend,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    on_device,
+    backend_fw,
+):
+    input_dtype, x = dtype_and_x
+    assume(not np.any(np.isclose(x[0], 0)))
+    assume(not np.any(np.isclose(x[1], 0)))
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        init_all_as_kwargs_np={
+            "value": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={
+            "y": x[1],
+        },
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )
+
+
 # reshape
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
__int__



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
@@ -214,6 +214,13 @@ def __neg__(self):
     def __rdiv__(self, y, /, name=None):
         return paddle_frontend.divide(y, self)
 
+    @with_unsupported_dtypes(
+        {"2.5.2 and below": ("bool", "unsigned", "int8", "float16", "bfloat16")},
+        "paddle",
+    )
+    def __int__(self):
+        return int(self._ivy_array)
+
     # Instance Methods #
     # ---------------- #
 


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
@@ -756,6 +756,45 @@ def test_paddle__getitem__(
     )
 
 
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="__int__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("integer"),
+        max_num_dims=0,
+        min_value=-1e15,
+        max_value=1e15,
+    ),
+)
+def test_paddle__int__(
+    dtype_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    backend_fw,
+    frontend,
+    on_device,
+):
+    input_dtypes, xs = dtype_and_x
+    # Numpy doesn't support complex to int conversion
+    assume(not np.issubdtype(input_dtypes[0], np.complexfloating))
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtypes,
+        backend_to_test=backend_fw,
+        method_input_dtypes=input_dtypes,
+        init_all_as_kwargs_np={
+            "object": xs[0],
+        },
+        method_all_as_kwargs_np={},
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )
+
+
 # __len__
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
Too many positional arguments for `staticmethod` calls
In the following function calls, the `self` argument is passed un-necessarily.
https://github.com/unifyai/ivy/blob/f5c75e99f3a414ced9b580ad0c3e815a002c1ce9/ivy/data_classes/container/creation.py#L1656-L1667
From the actual function definition `self` should not be passed.
https://github.com/unifyai/ivy/blob/f5c75e99f3a414ced9b580ad0c3e815a002c1ce9/ivy/data_classes/container/creation.py#L1616-L1628
https://github.com/unifyai/ivy/blob/f5c75e99f3a414ced9b580ad0c3e815a002c1ce9/ivy/data_classes/container/experimental/creation.py#L601-L611
From the actual function definition `self` should not be passed.
https://github.com/unifyai/ivy/blob/f5c75e99f3a414ced9b580ad0c3e815a002c1ce9/ivy/data_classes/container/experimental/creation.py#L564-L575


Discussion:

Resolving patch:
diff --git a/ivy/data_classes/container/creation.py b/ivy/data_classes/container/creation.py
--- a/ivy/data_classes/container/creation.py
+++ b/ivy/data_classes/container/creation.py
@@ -1654,7 +1654,6 @@ def triu_indices(
         out: Optional[Union[Tuple[ivy.Array], ivy.Container]] = None,
     ) -> ivy.Container:
         return self.static_triu_indices(
-            self,
             n_rows,
             n_cols,
             k,
diff --git a/ivy/data_classes/container/experimental/creation.py b/ivy/data_classes/container/experimental/creation.py
--- a/ivy/data_classes/container/experimental/creation.py
+++ b/ivy/data_classes/container/experimental/creation.py
@@ -599,7 +599,6 @@ def tril_indices(
         device: Optional[Union[ivy.Device, ivy.NativeDevice, ivy.Container]] = None,
     ) -> ivy.Container:
         return self.static_tril_indices(
-            self,
             n_rows,
             n_cols,
             k,


Test patch:
Repository: ivy-llc/ivy

Issue:
No value for argument `prob` in function call
In the following function call, the argument is passed wrongly as `p=p`.
https://github.com/unifyai/ivy/blob/039f79399f6f8c8d2db8ac33577ea6dcd34fb08b/ivy/functional/frontends/paddle/nn/functional/common.py#L58
From the function definition, it should be passed just as `p` because argument `prob` is a position only argument.
https://github.com/unifyai/ivy/blob/039f79399f6f8c8d2db8ac33577ea6dcd34fb08b/ivy/functional/ivy/experimental/layers.py#L1016-L1024


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/nn/functional/common.py b/ivy/functional/frontends/paddle/nn/functional/common.py
--- a/ivy/functional/frontends/paddle/nn/functional/common.py
+++ b/ivy/functional/frontends/paddle/nn/functional/common.py
@@ -55,7 +55,7 @@ def dropout(x, p=0.5, axis=None, training=True, mode="upscale_in_train", name=No
 @to_ivy_arrays_and_back
 @with_supported_dtypes({"2.5.2 and below": ("float32", "float64")}, "paddle")
 def dropout2d(x, *, p=0.5, training=True, data_format="NCHW", name=None):
-    return ivy.dropout2d(x, p=p, training=training, data_format=data_format)
+    return ivy.dropout2d(x, p, training=training, data_format=data_format)
 
 
 @to_ivy_arrays_and_back


Test patch:
Repository: ivy-llc/ivy

Issue:
No value for argument `dims` in function call
In the following function call, the `dims` argument is not passed.
https://github.com/unifyai/ivy/blob/79de1aaeb45883e8a9a3119caa749dfac39d9b34/ivy/functional/frontends/torch/tensor.py#L851
From the if-else conditions above, this function call happens when both `dims` and `args` are `None`.
https://github.com/unifyai/ivy/blob/79de1aaeb45883e8a9a3119caa749dfac39d9b34/ivy/functional/frontends/torch/tensor.py#L840-L851
This is similar to this issue #27351 which Is fixed here https://github.com/unifyai/ivy/pull/27363.


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
@@ -849,7 +849,8 @@ def permute(self, *args, dims=None):
                 return torch_frontend.permute(self, dims)
             else:
                 return torch_frontend.permute(self, args)
-        return torch_frontend.permute(self)
+        else:
+            raise ValueError("permute() got no values for argument 'dims'")
 
     @numpy_to_torch_style_args
     @with_unsupported_dtypes({"2.1.1 and below": ("float16", "bfloat16")}, "torch")


Test patch:
Repository: ivy-llc/ivy

Issue:
gather

gather



Discussion:

Resolving patch:
diff --git a/ivy/functional/backends/torch/general.py b/ivy/functional/backends/torch/general.py
--- a/ivy/functional/backends/torch/general.py
+++ b/ivy/functional/backends/torch/general.py
@@ -205,8 +205,9 @@ def gather(
             result.append(r)
         result = torch.stack(result)
         result = result.reshape([*params.shape[0:batch_dims], *result.shape[1:]])
-        if out:
-            out[:] = result
+    if ivy.exists(out):
+        return ivy.inplace_update(out, result)
+
     return result
 
 


Test patch:
Repository: ivy-llc/ivy

Issue:
Too many positional arguments for `ivy.layer_norm` function call
In the following file the function `ivy.layer_norm` is called with too many positional arguments.
https://github.com/unifyai/ivy/blob/4f4d7b2988bcfb6291025473b860e442c013c2ef/ivy/functional/frontends/paddle/nn/functional/norm.py#L10
From the actual function definition, `weight`, `bias`, and `epsilon` should be passed as key-word only arguments.
https://github.com/unifyai/ivy/blob/4f4d7b2988bcfb6291025473b860e442c013c2ef/ivy/functional/ivy/norms.py#L24-L34


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/nn/functional/norm.py b/ivy/functional/frontends/paddle/nn/functional/norm.py
--- a/ivy/functional/frontends/paddle/nn/functional/norm.py
+++ b/ivy/functional/frontends/paddle/nn/functional/norm.py
@@ -7,7 +7,7 @@
 @to_ivy_arrays_and_back
 @with_supported_dtypes({"2.5.2 and below": ("float32", "float64")}, "paddle")
 def layer_norm(x, normalized_shape, weight=None, bias=None, epsilon=1e-05, name=None):
-    return ivy.layer_norm(x, normalized_shape, weight, bias, epsilon)
+    return ivy.layer_norm(x, normalized_shape, scale=weight, offset=bias, eps=epsilon)
 
 
 @to_ivy_arrays_and_back


Test patch:
Repository: ivy-llc/ivy

Issue:
numpy.min



Discussion:
@alvin-98 can i work on this issue 
Hi @20481A05K0, I'm almost done with this one. Going to create a PR now. 
Okay thanks for responding 
But @alvin-98 I have one doubt there is no transpose method for matrices in numpy I have opened the issue but where should I implement that logic

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py b/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py
--- a/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py
+++ b/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py
@@ -191,6 +191,22 @@ def amin(
     return ivy.astype(res, out_dtype, out=out, copy=False)
 
 
+@handle_numpy_out
+@to_ivy_arrays_and_back
+@from_zero_dim_arrays_to_scalar
+def min(
+    a,
+    /,
+    *,
+    axis=None,
+    out=None,
+    keepdims=False,
+    initial=None,
+    where=True,
+):
+    return amin(a, axis=axis, out=out, keepdims=keepdims, initial=initial, where=where)
+
+
 @handle_numpy_out
 @to_ivy_arrays_and_back
 @from_zero_dim_arrays_to_scalar


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py
@@ -252,6 +252,55 @@ def test_numpy_maximum(
     )
 
 
+@handle_frontend_test(
+    fn_tree="numpy.min",
+    dtype_x_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_num_dims=1,
+        valid_axis=True,
+        force_int_axis=True,
+        large_abs_safety_factor=2,
+        safety_factor_scale="log",
+    ),
+    initial=st.one_of(st.floats(min_value=-1000, max_value=1000), st.none()),
+    keepdims=st.booleans(),
+    where=np_frontend_helpers.where(),
+)
+def test_numpy_min(
+    dtype_x_axis,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+    where,
+    initial,
+    keepdims,
+):
+    if initial is None and np.all(where) is not True:
+        assume(initial is inf)
+
+    input_dtypes, x, axis = dtype_x_axis
+    where, input_dtypes, test_flags = np_frontend_helpers.handle_where_and_array_bools(
+        where=where,
+        input_dtype=input_dtypes,
+        test_flags=test_flags,
+    )
+    np_frontend_helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        a=x[0],
+        axis=axis,
+        keepdims=keepdims,
+        initial=initial,
+        where=where,
+    )
+
+
 # minimum
 @handle_frontend_test(
     fn_tree="numpy.minimum",
Repository: ivy-llc/ivy

Issue:
numpy.max



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py b/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py
--- a/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py
+++ b/ivy/functional/frontends/numpy/mathematical_functions/extrema_finding.py
@@ -191,6 +191,22 @@ def amin(
     return ivy.astype(res, out_dtype, out=out, copy=False)
 
 
+@handle_numpy_out
+@to_ivy_arrays_and_back
+@from_zero_dim_arrays_to_scalar
+def max(
+    a,
+    /,
+    *,
+    axis=None,
+    out=None,
+    keepdims=False,
+    initial=None,
+    where=True,
+):
+    return amax(a, axis=axis, out=out, keepdims=keepdims, initial=initial, where=where)
+
+
 @handle_numpy_out
 @to_ivy_arrays_and_back
 @from_zero_dim_arrays_to_scalar


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_extrema_finding.py
@@ -202,6 +202,54 @@ def test_numpy_fmin(
     )
 
 
+@handle_frontend_test(
+    fn_tree="numpy.max",
+    dtype_x_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_num_dims=1,
+        valid_axis=True,
+        force_int_axis=True,
+        large_abs_safety_factor=2,
+        safety_factor_scale="log",
+    ),
+    initial=st.one_of(st.floats(min_value=-1000, max_value=1000), st.none()),
+    keepdims=st.booleans(),
+    where=np_frontend_helpers.where(),
+)
+def test_numpy_max(
+    dtype_x_axis,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+    where,
+    initial,
+    keepdims,
+):
+    if initial is None and np.all(where) is not True:
+        assume(initial is +inf)
+    input_dtypes, x, axis = dtype_x_axis
+    where, input_dtypes, test_flags = np_frontend_helpers.handle_where_and_array_bools(
+        where=where,
+        input_dtype=input_dtypes,
+        test_flags=test_flags,
+    )
+    np_frontend_helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        a=x[0],
+        axis=axis,
+        keepdims=keepdims,
+        initial=initial,
+        where=where,
+    )
+
+
 # maximum
 @handle_frontend_test(
     fn_tree="numpy.maximum",
Repository: ivy-llc/ivy

Issue:
Wrong key-word argument `seed` is passed instead of `bit_generator`
In the following line, the class `Generator` is called with wrong key-word argument `seed`.
https://github.com/unifyai/ivy/blob/1948300fad770695c3df18aea42751056871396a/ivy/functional/frontends/numpy/random/Generator/Generator.py#L13-L14
From the actual definition of the `Generator` class, the argument should be `bit_generator`.
https://github.com/unifyai/ivy/blob/1948300fad770695c3df18aea42751056871396a/ivy/functional/frontends/numpy/random/Generator/Generator.py#L5-L10


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/random/Generator/Generator.py b/ivy/functional/frontends/numpy/random/Generator/Generator.py
--- a/ivy/functional/frontends/numpy/random/Generator/Generator.py
+++ b/ivy/functional/frontends/numpy/random/Generator/Generator.py
@@ -11,4 +11,4 @@ def multinomial(self, n, pvals, size=None):
 
 
 def default__rng(seed=None):
-    return Generator(seed=seed)
+    return Generator(bit_generator=seed)


Test patch:
Repository: ivy-llc/ivy

Issue:
Wrong positional argument for function call `ivy.matrix_transpose()`
In the following function call the argument `allaxes` is wrongly passed.
https://github.com/unifyai/ivy/blob/6f408fc5efb588530375527bc15e50ca0a8241a7/ivy/functional/ivy/linear_algebra.py#L3185

From the actual function definition of `matrix_transpose` only 1 positional argument should be passed. So, the argument `allaxes` should not be passed.
https://github.com/unifyai/ivy/blob/6f408fc5efb588530375527bc15e50ca0a8241a7/ivy/functional/ivy/linear_algebra.py#L1526-L1532


Discussion:

Resolving patch:
diff --git a/ivy/functional/ivy/linear_algebra.py b/ivy/functional/ivy/linear_algebra.py
--- a/ivy/functional/ivy/linear_algebra.py
+++ b/ivy/functional/ivy/linear_algebra.py
@@ -3182,7 +3182,7 @@ def tensorsolve(
             allaxes.remove(k)
             allaxes.insert(ndim1, k)
 
-        x1 = ivy.matrix_transpose(x1, allaxes)
+        x1 = ivy.matrix_transpose(x1)
 
     old_shape = x1.shape[-(ndim1 - ndim2) :]
 


Test patch:
Repository: ivy-llc/ivy

Issue:
numpy.isin



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/logic/array_contents.py b/ivy/functional/frontends/numpy/logic/array_contents.py
--- a/ivy/functional/frontends/numpy/logic/array_contents.py
+++ b/ivy/functional/frontends/numpy/logic/array_contents.py
@@ -7,6 +7,7 @@
     handle_numpy_out,
 )
 from ivy.functional.frontends.numpy import promote_types_of_numpy_inputs
+from ivy.func_wrapper import with_supported_dtypes
 
 
 @inputs_to_ivy_arrays
@@ -23,6 +24,14 @@ def isclose(a, b, /, *, rtol=1e-05, atol=1e-08, equal_nan=False):
     return ivy.isclose(a, b, rtol=rtol, atol=atol, equal_nan=equal_nan)
 
 
+@with_supported_dtypes(
+    {"2.5.2 and below": ("int64", "float64", "float32", "int32", "bfloat16")}, "paddle"
+)
+@to_ivy_arrays_and_back
+def isin(element, test_elements, assume_unique=False, invert=False):
+    return ivy.isin(element, test_elements, assume_unique=assume_unique, invert=invert)
+
+
 @handle_numpy_out
 @to_ivy_arrays_and_back
 @from_zero_dim_arrays_to_scalar


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_logic/test_array_contents.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_logic/test_array_contents.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_logic/test_array_contents.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_logic/test_array_contents.py
@@ -7,6 +7,25 @@
 from ivy_tests.test_ivy.helpers import handle_frontend_test
 
 
+# --- Helpers --- #
+# --------------- #
+
+
+# isin
+@st.composite
+def _isin_data_generation_helper(draw):
+    dtype_and_x = helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        num_arrays=2,
+        shared_dtype=True,
+    )
+    return draw(dtype_and_x)
+
+
+# --- Main --- #
+# ------------ #
+
+
 @handle_frontend_test(
     fn_tree="numpy.allclose",
     dtype_and_x=helpers.dtype_and_values(
@@ -75,6 +94,38 @@ def test_numpy_isclose(
     )
 
 
+# isin
+@handle_frontend_test(
+    fn_tree="numpy.isin",
+    assume_unique_and_dtype_and_x=_isin_data_generation_helper(),
+    invert=st.booleans(),
+)
+def test_numpy_isin(
+    *,
+    assume_unique_and_dtype_and_x,
+    invert,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    x_and_dtype = assume_unique_and_dtype_and_x
+    dtypes, values = x_and_dtype
+    elements, test_elements = values
+    helpers.test_frontend_function(
+        input_dtypes=dtypes,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        element=elements,
+        test_elements=test_elements,
+        invert=invert,
+        backend_to_test=backend_fw,
+    )
+
+
 @handle_frontend_test(
     fn_tree="numpy.isneginf",
     dtype_and_x=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
torch.Tensor.frac



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
@@ -2017,6 +2017,10 @@ def uniform_(self, from_=0, to=1, *, generator=None):
         )
         return self
 
+    @with_supported_dtypes({"2.1.1 and below": ("float32", "float64")}, "torch")
+    def frac(self, name=None):
+        return torch_frontend.frac(self._ivy_array)
+
     @with_unsupported_dtypes(
         {
             "2.1.1 and below": (


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
@@ -7088,6 +7088,44 @@ def test_torch_fmod_(
     )
 
 
+# frac
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="frac",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes(kind="valid"),
+        num_arrays=1,
+        max_value=1e6,
+        min_value=-1e6,
+    ),
+)
+def test_torch_frac(
+    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={},
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
+
+
 @handle_frontend_method(
     class_tree=CLASS_TREE,
     init_tree="torch.tensor",