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

Issue:
reshape_



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/manipulation.py b/ivy/functional/frontends/paddle/tensor/manipulation.py
--- a/ivy/functional/frontends/paddle/tensor/manipulation.py
+++ b/ivy/functional/frontends/paddle/tensor/manipulation.py
@@ -15,6 +15,17 @@ def reshape(x, shape):
     return ivy.reshape(x, shape)
 
 
+@with_unsupported_dtypes(
+    {"2.5.1 and below": ("int8", "uint8", "int16", "uint16", "float16", "bfloat16")},
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def reshape_(x, shape):
+    ret = ivy.reshape(x, shape)
+    ivy.inplace_update(x, ret)
+    return x
+
+
 @with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
 @to_ivy_arrays_and_back
 def abs(x, name=None):


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_manipulation.py
@@ -31,6 +31,18 @@ def dtypes_x_reshape(draw):
     return dtypes, x, shape
 
 
+@st.composite
+def dtypes_x_reshape_(draw):
+    shape = draw(helpers.get_shape(min_num_dims=1))
+    dtypes, x = draw(
+        helpers.dtype_and_values(
+            available_dtypes=helpers.get_dtypes("numeric"),
+            shape=shape,
+        )
+    )
+    return dtypes, x, shape
+
+
 # Tests #
 # ----- #
 
@@ -62,6 +74,33 @@ def test_paddle_reshape(
     )
 
 
+# reshape_
+@handle_frontend_test(
+    fn_tree="paddle.reshape_",
+    dtypes_x_reshape=dtypes_x_reshape_(),
+)
+def test_paddle_reshape_(
+    *,
+    dtypes_x_reshape,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    input_dtype, x, shape = dtypes_x_reshape
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+        shape=shape,
+    )
+
+
 # abs
 @handle_frontend_test(
     fn_tree="paddle.abs",
Repository: ivy-llc/ivy

Issue:
Fix paddle_linalg.test_paddle_norm
|   |   |
|---|---|
|paddle|<a href="https://github.com/unifyai/ivy/actions/runs/5478319447"><img src=https://img.shields.io/badge/-failure-red></a>
|jax|<a href="https://github.com/unifyai/ivy/actions/runs/5478319447"><img src=https://img.shields.io/badge/-failure-red></a>
|tensorflow|<a href="https://github.com/unifyai/ivy/actions/runs/5478319447"><img src=https://img.shields.io/badge/-failure-red></a>
|torch|<a href="https://github.com/unifyai/ivy/actions/runs/5478319447"><img src=https://img.shields.io/badge/-failure-red></a>
|numpy|<a href="https://github.com/unifyai/ivy/actions/runs/5478319447"><img src=https://img.shields.io/badge/-failure-red></a>



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
@@ -34,8 +34,6 @@ def norm(x, p="fro", axis=None, keepdim=False, name=None):
         ret = ivy.vector_norm(x.flatten(), ord=p, axis=-1)
         if keepdim:
             ret = ret.reshape([1] * len(x.shape))
-        if len(ret.shape) == 0:
-            return ivy.array([ret])
         return ret
 
     if isinstance(axis, tuple):
@@ -76,10 +74,6 @@ def norm(x, p="fro", axis=None, keepdim=False, name=None):
     else:
         raise ValueError
 
-    if len(ret.shape) == 0:
-        ret = ivy.array(
-            [ret]
-        )  # this is done so as to match shape of output from paddle
     return ret
 
 


Test patch:
Repository: ivy-llc/ivy

Issue:
random_



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
@@ -1848,6 +1848,38 @@ def quantile(self, q, dim=None, keepdim=False, *, interpolation="linear", out=No
             self, q, axis=dim, keepdims=keepdim, interpolation=interpolation, out=out
         )
 
+    @with_unsupported_dtypes(
+        {
+            "2.0.1 and below": (
+                "int8",
+                "int16",
+                "uint8",
+                "uint16",
+                "uint32",
+                "uint64",
+                "bfloat16",
+                "float64",
+            )
+        },
+        "torch",
+    )
+    def random_(
+        self,
+        from_=0,
+        to=None,
+        *,
+        generator=None,
+    ):
+        if to is None:
+            if ivy.is_float_dtype(self.ivy_array):
+                to = ivy.finfo(self.dtype).max
+            else:
+                to = ivy.iinfo(self.dtype).max
+        self.ivy_array = ivy.random_uniform(
+            low=from_, high=to, shape=self.size(), dtype=self.dtype
+        )
+        return self.ivy_array
+
     @with_unsupported_dtypes(
         {
             "2.0.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
@@ -9873,6 +9873,50 @@ def test_torch_tensor_quantile(
     )
 
 
+# random_
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="torch.tensor",
+    method_name="random_",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float_and_integer"),
+        min_value=1,
+        max_value=5,
+        min_num_dims=1,
+        max_num_dims=5,
+    ),
+    to=helpers.ints(min_value=1, max_value=100),
+)
+def test_torch_tensor_random_(
+    dtype_and_x,
+    to,
+    frontend,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    on_device,
+    backend_fw,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        method_input_dtypes=input_dtype,
+        frontend_method_data=frontend_method_data,
+        init_all_as_kwargs_np={
+            "data": x[0],
+        },
+        method_all_as_kwargs_np={
+            "to": to,
+        },
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+        test_values=False,
+    )
+
+
 # ravel
 @handle_frontend_method(
     class_tree=CLASS_TREE,
Repository: ivy-llc/ivy

Issue:
broadcast_to



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/miscellaneous_ops.py b/ivy/functional/frontends/torch/miscellaneous_ops.py
--- a/ivy/functional/frontends/torch/miscellaneous_ops.py
+++ b/ivy/functional/frontends/torch/miscellaneous_ops.py
@@ -364,6 +364,12 @@ def broadcast_shapes(*shapes):
     return ivy.broadcast_shapes(*shapes)
 
 
+@with_unsupported_dtypes({"2.0.1 and below": ("bfloat16",)}, "torch")
+@to_ivy_arrays_and_back
+def broadcast_to(tensor, shape):
+    return ivy.broadcast_to(tensor, shape)
+
+
 @to_ivy_arrays_and_back
 def atleast_2d(*tensors):
     return ivy.atleast_2d(*tensors)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_miscellaneous_ops.py
@@ -1252,6 +1252,65 @@ def test_torch_broadcast_shapes(
     assert ret == frontend_ret
 
 
+@st.composite
+def _get_input_and_broadcast_shape(draw):
+    # Determine the dimensionality of the tensor, ranging from scalar (0D) to 3D.
+    num_dims = draw(st.integers(min_value=0, max_value=3))
+
+    # Generate the dimensions of the tensor.
+    dims = [draw(st.integers(min_value=1, max_value=5)) for _ in range(num_dims)]
+
+    # Make Tensor.
+    x_dtype, x = draw(
+        helpers.dtype_and_values(
+            available_dtypes=helpers.get_dtypes("valid"), shape=dims
+        )
+    )
+
+    # Define the broadcast shape dimension
+    broadcast_num_dims = draw(st.integers(min_value=num_dims, max_value=3))
+
+    # Construct the broadcast shape.
+    if broadcast_num_dims == num_dims:
+        shape = tuple(dims)
+    else:
+        shape_components = [
+            draw(st.integers(min_value=1, max_value=5))
+            for _ in range(broadcast_num_dims - num_dims)
+        ]
+        shape = tuple(shape_components) + tuple(dims)
+
+    return x_dtype, x, shape
+
+
+@handle_frontend_test(
+    fn_tree="torch.broadcast_to",
+    array_and_shape=_get_input_and_broadcast_shape(),
+    test_with_out=st.just(False),
+)
+def test_torch_broadcast_to(
+    *,
+    array_and_shape,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    input_dtype, array, shape = array_and_shape
+    test_flags.num_positional_args = 2
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        array=array[0],
+        shape=shape,
+    )
+
+
 # atleast_2d
 @handle_frontend_test(
     fn_tree="torch.atleast_2d",
Repository: ivy-llc/ivy

Issue:
round



Discussion:

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
@@ -703,3 +703,6 @@ def __rshift__(self, value, /):
 
     def __lshift__(self, value, /):
         return ivy.bitwise_left_shift(self.ivy_array, value)
+
+    def round(self, decimals=0, out=None):
+        return np_frontend.round(self, decimals=decimals, out=out)


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
@@ -3568,3 +3568,45 @@ def test_numpy___invert__(
         method_flags=method_flags,
         on_device=on_device,
     )
+
+
+# round
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="numpy.array",
+    method_name="round",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float", full=False),
+        num_arrays=1,
+        max_value=50,
+        min_value=-50,
+    ),
+    decimals=st.integers(min_value=0, max_value=3),
+)
+def test_numpy_ndarray_round(
+    dtype_and_x,
+    decimals,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    backend_fw,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        method_input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        init_all_as_kwargs_np={
+            "object": x,
+        },
+        method_all_as_kwargs_np={
+            "decimals": decimals,
+        },
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
binary_cross_entropy



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/nn/functional/loss.py b/ivy/functional/frontends/paddle/nn/functional/loss.py
--- a/ivy/functional/frontends/paddle/nn/functional/loss.py
+++ b/ivy/functional/frontends/paddle/nn/functional/loss.py
@@ -44,6 +44,17 @@ def _pairwise_distance(x1, x2, *, p=2.0, eps=1e-06, keepdim=False):
 # ------------ #
 
 
+@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
+@to_ivy_arrays_and_back
+def binary_cross_entropy(input, label, weight=None, reduction="mean", name=None):
+    reduction = _get_reduction_func(reduction)
+    result = ivy.binary_cross_entropy(label, input, epsilon=0.0)
+    if weight is not None:
+        result = ivy.multiply(weight, result)
+    result = reduction(result)
+    return result
+
+
 @with_supported_dtypes(
     {"2.5.1 and below": ("float32",)},
     "paddle",


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py
@@ -40,6 +40,51 @@ def _cos_embd_loss_helper(draw):
 # ------------ #
 
 
+@handle_frontend_test(
+    fn_tree="paddle.nn.functional.binary_cross_entropy",
+    dtype_and_vals=helpers.dtype_and_values(
+        available_dtypes=["float32", "float64"],
+        num_arrays=3,
+        min_value=1.0013580322265625e-05,
+        max_value=1,
+        large_abs_safety_factor=2,
+        small_abs_safety_factor=2,
+        safety_factor_scale="linear",
+        allow_inf=False,
+        exclude_min=True,
+        exclude_max=True,
+        min_num_dims=1,
+        max_num_dims=1,
+        min_dim_size=2,
+    ),
+    reduction=st.sampled_from(["mean", "sum", "none"]),
+)
+def test_paddle_binary_cross_entropy(
+    dtype_and_vals,
+    reduction,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    input_dtype, x = dtype_and_vals
+    helpers.test_frontend_function(
+        input_dtypes=[input_dtype[0], input_dtype[1]],
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=x[0],
+        label=x[1],
+        weight=x[2],
+        reduction=reduction,
+        rtol=1e-02,
+        atol=1e-02,
+    )
+
+
 @handle_frontend_test(
     fn_tree="paddle.nn.functional.binary_cross_entropy_with_logits",
     dtype_and_x=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
 square_error_cost



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/nn/functional/loss.py b/ivy/functional/frontends/paddle/nn/functional/loss.py
--- a/ivy/functional/frontends/paddle/nn/functional/loss.py
+++ b/ivy/functional/frontends/paddle/nn/functional/loss.py
@@ -324,6 +324,12 @@ def smooth_l1_loss(
     return out.astype(label.dtype)
 
 
+@with_supported_dtypes({"2.5.1 and below": ("float32",)}, "paddle")
+@to_ivy_arrays_and_back
+def square_error_cost(input, label):
+    return ivy.square(ivy.subtract(input, label))
+
+
 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
 @to_ivy_arrays_and_back
 def triplet_margin_loss(


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_loss.py
@@ -511,6 +511,33 @@ def test_paddle_smooth_l1_loss(
     )
 
 
+@handle_frontend_test(
+    fn_tree="paddle.nn.functional.loss.square_error_cost",
+    dtype_and_input_and_label=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"), num_arrays=2
+    ),
+)
+def test_paddle_square_error_cost(
+    *,
+    dtype_and_input_and_label,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+):
+    input_dtypes, input_and_label = dtype_and_input_and_label
+    input, label = input_and_label
+    helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        input=input,
+        label=label,
+        fn_tree=fn_tree,
+    )
+
+
 @handle_frontend_test(
     fn_tree="paddle.nn.functional.triplet_margin_loss",
     dtype_and_inputs=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
round_



Discussion:
todolist#15039 

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
@@ -108,6 +108,12 @@ def round(x, name=None):
     return ivy.round(x)
 
 
+@with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
+@to_ivy_arrays_and_back
+def round_(x, name=None):
+    return ivy.inplace_update(x, round(x))
+
+
 @with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
 @to_ivy_arrays_and_back
 def ceil(x, name=None):
@@ -400,6 +406,11 @@ def rsqrt(x, name=None):
     return 1 / ivy.sqrt(x)
 
 
+@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
+def rsqrt_(x, name=None):
+    return ivy.inplace_update(x, ivy.reciprocal(ivy.inplace_update(x, ivy.sqrt(x))))
+
+
 @with_supported_dtypes(
     {"2.5.1 and below": ("float32", "float64", "int32", "int64")}, "paddle"
 )


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
@@ -492,6 +492,35 @@ def test_paddle_round(
     )
 
 
+# round_
+@handle_frontend_test(
+    fn_tree="paddle.tensor.math.round_",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_value=1,
+    ),
+)
+def test_paddle_round_(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+    )
+
+
 # ceil
 @handle_frontend_test(
     fn_tree="paddle.tensor.math.ceil",
@@ -1748,6 +1777,34 @@ def test_paddle_rsqrt(
     )
 
 
+# rsqrt_
+@handle_frontend_test(
+    fn_tree="paddle.tensor.math.rsqrt_",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_rsqrt_(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+    backend_fw,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+    )
+
+
 # prod
 @handle_frontend_test(
     fn_tree="paddle.tensor.math.prod",
Repository: ivy-llc/ivy

Issue:
max



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/array.py b/ivy/functional/frontends/jax/array.py
--- a/ivy/functional/frontends/jax/array.py
+++ b/ivy/functional/frontends/jax/array.py
@@ -334,6 +334,19 @@ def repeat(self, repeats, axis=None, *, total_repeat_length=None):
     def searchsorted(self, v, side="left", sorter=None, *, method="scan"):
         return jax_frontend.numpy.searchsorted(self, v, side=side, sorter=sorter)
 
+    def max(
+        self,
+        /,
+        *,
+        axis=None,
+        out=None,
+        keepdims=False,
+        where=None,
+    ):
+        return jax_frontend.numpy.max(
+            self, axis=axis, out=out, keepdims=keepdims, where=where
+        )
+
     def ptp(self, *, axis=None, out=None, keepdims=False):
         return jax_frontend.numpy.ptp(self, axis=axis, keepdims=keepdims)
 


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_array.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_array.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_array.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_array.py
@@ -2387,6 +2387,49 @@ def test_jax_array_ptp(
     )
 
 
+# max
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="jax.numpy.array",
+    method_name="max",
+    dtype_and_x=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("float"),
+        force_int_axis=True,
+        min_num_dims=1,
+        valid_axis=True,
+    ),
+    keepdims=st.booleans(),
+)
+def test_jax_array_max(
+    dtype_and_x,
+    keepdims,
+    on_device,
+    frontend,
+    backend_fw,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+):
+    input_dtype, x, axis = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        init_all_as_kwargs_np={
+            "object": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={
+            "axis": axis,
+            "keepdims": keepdims,
+        },
+        frontend=frontend,
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        on_device=on_device,
+    )
+
+
 # searchsorted
 @st.composite
 def _searchsorted(draw):
Repository: ivy-llc/ivy

Issue:
mvlgamma



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/pointwise_ops.py b/ivy/functional/frontends/torch/pointwise_ops.py
--- a/ivy/functional/frontends/torch/pointwise_ops.py
+++ b/ivy/functional/frontends/torch/pointwise_ops.py
@@ -384,6 +384,22 @@ def mul(input, other, *, out=None):
     return ivy.multiply(input, other, out=out)
 
 
+@to_ivy_arrays_and_back
+@with_unsupported_dtypes({"2.0.1 and below": ("float16",)}, "torch")
+def mvlgamma(input, p, *, out=None):
+    ivy.assertions.check_greater(
+        p, 1, allow_equal=True, message="p has to be greater than or equal to 1"
+    )
+    c = 0.25 * p * (p - 1) * ivy.log(ivy.pi, out=out)
+    b = 0.5 * ivy.arange((1 - p), 1, 1, dtype=input.dtype, device=input.device, out=out)
+    return (
+        ivy.sum(
+            ivy.lgamma(ivy.expand_dims(input, axis=-1) + b, out=out), axis=-1, out=out
+        )
+        + c
+    )
+
+
 @with_unsupported_dtypes({"2.0.1 and below": ("bfloat16",)}, "tensorflow")
 @to_ivy_arrays_and_back
 def nan_to_num(input, nan=0.0, posinf=None, neginf=None, *, out=None):


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py
@@ -2153,6 +2153,30 @@ def test_torch_mul(
     )
 
 
+# mvlgamma
+@handle_frontend_test(
+    fn_tree="torch.mvlgamma",
+    dtype_and_input=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float")
+    ),
+    p=helpers.ints(min_value=1, max_value=11),
+)
+def test_torch_mvlgamma(
+    *, dtype_and_input, frontend, test_flags, fn_tree, backend_fw, on_device, p
+):
+    input_dtype, input = dtype_and_input
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=input[0],
+        p=p,
+    )
+
+
 @handle_frontend_test(
     fn_tree="torch.nan_to_num",
     dtype_and_x=helpers.dtype_and_values(