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

Issue:
ELU



Discussion:

Resolving patch:
diff --git a/ivy/stateful/activations.py b/ivy/stateful/activations.py
--- a/ivy/stateful/activations.py
+++ b/ivy/stateful/activations.py
@@ -367,3 +367,24 @@ def _forward(self, x):
             The outputs following the SELU activation *[batch_shape, d]*
         """
         return ivy.selu(x)
+
+
+class ELU(Module):
+    def __init__(self):
+        """Apply the ELU activation function."""
+        Module.__init__(self)
+
+    def _forward(self, x, alpha=1.0):
+        """
+        Parameters
+        ----------
+        x
+            Inputs to process *[batch_shape, d]*.
+        alpha
+            scaler for controlling the slope of the function for x <= 0 Default: 1.0
+        Returns
+        -------
+        ret
+            The outputs following the ELU activation *[batch_shape, d]*
+        """
+        return ivy.elu(x, alpha=alpha)


Test patch:
diff --git a/ivy_tests/test_ivy/test_stateful/test_activations.py b/ivy_tests/test_ivy/test_stateful/test_activations.py
--- a/ivy_tests/test_ivy/test_stateful/test_activations.py
+++ b/ivy_tests/test_ivy/test_stateful/test_activations.py
@@ -708,3 +708,49 @@ def test_selu(
         test_gradients=test_gradients,
         on_device=on_device,
     )
+
+
+# ELU
+@handle_method(
+    method_tree="stateful.activations.ELU.__call__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+        shared_dtype=True,
+        min_num_dims=2,
+        large_abs_safety_factor=8,
+        small_abs_safety_factor=8,
+        safety_factor_scale="log",
+    ),
+    method_num_positional_args=helpers.num_positional_args(fn_name="ELU._forward"),
+    test_gradients=st.just(True),
+    alpha=helpers.floats(min_value=0.1, max_value=1),
+)
+def test_elu(
+    *,
+    dtype_and_x,
+    alpha,
+    test_gradients,
+    class_name,
+    method_name,
+    ground_truth_backend,
+    init_flags,
+    method_flags,
+    on_device,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_method(
+        ground_truth_backend=ground_truth_backend,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        init_input_dtypes=input_dtype,
+        method_input_dtypes=input_dtype,
+        init_all_as_kwargs_np={},
+        method_all_as_kwargs_np={"x": x[0], "alpha": alpha},
+        class_name=class_name,
+        method_name=method_name,
+        rtol_=1e-2,
+        atol_=1e-2,
+        test_gradients=test_gradients,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
cos



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/mathematical_functions.py b/ivy/functional/frontends/jax/numpy/mathematical_functions.py
--- a/ivy/functional/frontends/jax/numpy/mathematical_functions.py
+++ b/ivy/functional/frontends/jax/numpy/mathematical_functions.py
@@ -714,3 +714,9 @@ def product(
 @to_ivy_arrays_and_back
 def conjugate(x, /):
     return ivy.conj(x)
+
+
+@to_ivy_arrays_and_back
+def cos(x, /):
+    return ivy.cos(x)
+    


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_mathematical_functions.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_mathematical_functions.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_mathematical_functions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_mathematical_functions.py
@@ -3222,3 +3222,30 @@ def test_jax_conjugate(
         on_device=on_device,
         x=x[0],
     )
+
+#cos
+@handle_frontend_test(
+    fn_tree="jax.numpy.cos",
+    dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("valid")),
+    test_with_out=st.just(False),
+)
+@with_supported_dtypes
+def test_jax_cos(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    backend_fw,
+    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,
+        backend_to_test=backend_fw,
+        on_device=on_device,
+        x=x[0],
+    )
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_trigonometric_functions.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_trigonometric_functions.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_trigonometric_functions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_trigonometric_functions.py
@@ -439,3 +439,4 @@ def test_numpy_degrees(
         dtype=dtype,
         subok=True,
     )
+
Repository: ivy-llc/ivy

Issue:
xdivy



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/tensorflow/math.py b/ivy/functional/frontends/tensorflow/math.py
--- a/ivy/functional/frontends/tensorflow/math.py
+++ b/ivy/functional/frontends/tensorflow/math.py
@@ -732,6 +732,18 @@ def atanh(x, name="atanh"):
     return ivy.atanh(x)
 
 
+@with_supported_dtypes(
+    {"2.13.0 and below": ("float32", "float64", "complex64", "complex128")},
+    "tensorflow",
+)
+@to_ivy_arrays_and_back
+def xdivy(x, y, name=None):
+    x, y = check_tensorflow_casting(x, y)
+    if (x == 0).all():
+        return 0.0
+    return ivy.divide(x, y)
+
+
 @with_supported_dtypes(
     {"2.13.0 and below": ("int32",)},
     "tensorflow",


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
@@ -2924,6 +2924,38 @@ def test_tensorflow_bincount(
     )
 
 
+# xdivy
+@handle_frontend_test(
+    fn_tree="tensorflow.math.xdivy",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+        shared_dtype=True,
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_xdivy(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+):
+    input_dtype, xs = 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=xs[0],
+        y=xs[1],
+    )
+
+
 # Xlog1py
 @handle_frontend_test(
     fn_tree="tensorflow.math.xlog1py",
Repository: ivy-llc/ivy

Issue:
xlog1py



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/tensorflow/math.py b/ivy/functional/frontends/tensorflow/math.py
--- a/ivy/functional/frontends/tensorflow/math.py
+++ b/ivy/functional/frontends/tensorflow/math.py
@@ -750,6 +750,13 @@ def bincount(
     return ivy.bincount(arr, weights=weights, minlength=minlength)
 
 
+@to_ivy_arrays_and_back
+@with_supported_dtypes({"2.13.0 and below": ("float32", "float64")}, "tensorflow")
+def xlog1py(x, y, name=None):
+    x, y = check_tensorflow_casting(x, y)
+    return x * ivy.log1p(y)
+
+
 @with_supported_device_and_dtypes(
     {
         "2.13.0 and below": {


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_math.py
@@ -2924,6 +2924,38 @@ def test_tensorflow_bincount(
     )
 
 
+# Xlog1py
+@handle_frontend_test(
+    fn_tree="tensorflow.math.xlog1py",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        num_arrays=2,
+        shared_dtype=True,
+    ),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_xlog1py(
+    *,
+    dtype_and_x,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+):
+    input_dtype, xs = 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=xs[0],
+        y=xs[1],
+    )
+
+
 @handle_frontend_test(
     fn_tree="tensorflow.math.igamma",
     dtype_and_x=helpers.dtype_and_values(
Repository: ivy-llc/ivy

Issue:
isin



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/logic.py b/ivy/functional/frontends/jax/numpy/logic.py
--- a/ivy/functional/frontends/jax/numpy/logic.py
+++ b/ivy/functional/frontends/jax/numpy/logic.py
@@ -128,7 +128,6 @@ def any(a, axis=None, out=None, keepdims=False, *, where=None):
 
 alltrue = all
 
-
 sometrue = any
 from ivy.functional.frontends.jax.numpy import promote_types_of_jax_inputs
 
@@ -156,6 +155,11 @@ def isfinite(x, /):
     return ivy.isfinite(x)
 
 
+@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)
+
+
 @to_ivy_arrays_and_back
 def isinf(x, /):
     return ivy.isinf(x)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_logic.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_logic.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_logic.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_logic.py
@@ -633,6 +633,47 @@ def test_jax_isfinite(
     )
 
 
+# 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)
+
+
+@handle_frontend_test(
+    fn_tree="jax.numpy.isin",
+    assume_unique_and_dtype_and_x=_isin_data_generation_helper(),
+    invert=st.booleans(),
+    test_with_out=st.just(False),
+)
+def test_jax_isin(
+    *,
+    assume_unique_and_dtype_and_x,
+    invert,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    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,
+    )
+
+
 # isinf
 @handle_frontend_test(
     fn_tree="jax.numpy.isinf",
Repository: ivy-llc/ivy

Issue:
adaptive_avg_pool3d

adaptive_avg_pool3d



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/nn/functional/pooling.py b/ivy/functional/frontends/paddle/nn/functional/pooling.py
--- a/ivy/functional/frontends/paddle/nn/functional/pooling.py
+++ b/ivy/functional/frontends/paddle/nn/functional/pooling.py
@@ -82,6 +82,10 @@ def adaptive_avg_pool1d(x, output_size, name=None):
 def adaptive_avg_pool2d(x, output_size, data_format="NCHW", name=None):
     return ivy.adaptive_avg_pool2d(x, output_size)
 
+@to_ivy_arrays_and_back
+@with_supported_dtypes({"2.5.0 and below": ("float32", "float64")}, "paddle")
+def adaptive_avg_pool3d(x, output_size, data_format="NCHW", name=None):
+    return ivy.adaptive_avg_pool3d(x, output_size)
 
 @to_ivy_arrays_and_back
 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_pooling.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_pooling.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_pooling.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_pooling.py
@@ -233,6 +233,45 @@ def test_paddle_adaptive_max_pool2d(
         output_size=output_size,
     )
 
+# adaptive_avg_pool3d
+@handle_frontend_test(
+    fn_tree="paddle.nn.functional.adaptive_avg_pool3d",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_num_dims=5,
+        max_num_dims=5,
+        min_dim_size=1,
+        max_value=100,
+        min_value=-100,
+    ),
+    output_size=st.one_of(
+        st.tuples(
+            helpers.ints(min_value=1, max_value=5),
+            helpers.ints(min_value=1, max_value=5),
+        ),
+        helpers.ints(min_value=1, max_value=5),
+    ),
+)
+def test_paddle_adaptive_avg_pool3d(
+    *,
+    dtype_and_x,
+    output_size,
+    test_flags,
+    frontend,
+    on_device,
+    fn_tree,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        on_device=on_device,
+        fn_tree=fn_tree,
+        x=x[0],
+        output_size=output_size,
+    )
+    
 
 # max_unpool1d
 @handle_frontend_test(
Repository: ivy-llc/ivy

Issue:
logistic
I will add logistic sampling in numpy frontend


Discussion:
This issue has been labelled as stale. If you would like to continue working on this issue, then please add another comment or create a PR . If a PR has already been created which refers to this issue, then you should explicitly mention this issue in the relevant PR. For more information please refer to this page in our documentation: https://lets-unify.ai/ivy/contributing/1_the_basics.html#todo-list-issues
Work in Progress 

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/random/functions.py b/ivy/functional/frontends/numpy/random/functions.py
--- a/ivy/functional/frontends/numpy/random/functions.py
+++ b/ivy/functional/frontends/numpy/random/functions.py
@@ -189,3 +189,11 @@ def gumbel(loc=0.0, scale=1.0, size=None):
 @from_zero_dim_arrays_to_scalar
 def gamma(shape, scale=1.0, size=None):
     return ivy.gamma(shape, scale, shape=size, dtype="float64")
+
+
+@to_ivy_arrays_and_back
+@from_zero_dim_arrays_to_scalar
+def logistic(loc=0.0, scale=1.0, size=None):
+    u = ivy.random_uniform(low=0.0, high=0.0, shape=size, dtype="float64")
+    x = loc + scale * ivy.log(u / (1 - u))
+    return x


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_random/test_functions.py
@@ -744,3 +744,47 @@ def test_numpy_gamma(
         scale=scale,
         size=size,
     )
+
+
+# logistic
+@handle_frontend_test(
+    fn_tree="numpy.random.logistic",
+    input_dtypes=helpers.get_dtypes("float", full=False),
+    loc=st.floats(
+        allow_nan=False,
+        allow_infinity=False,
+        width=32,
+        min_value=0,
+        exclude_min=True,
+    ),
+    scale=st.floats(
+        allow_nan=False,
+        allow_infinity=False,
+        width=32,
+        min_value=0,
+        exclude_min=True,
+    ),
+    size=helpers.get_shape(allow_none=True),
+    test_with_out=st.just(False),
+)
+def test_numpy_logistic(
+    input_dtypes,
+    size,
+    frontend,
+    test_flags,
+    fn_tree,
+    on_device,
+    loc,
+    scale,
+):
+    helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        test_values=False,
+        loc=loc,
+        scale=scale,
+        size=size,
+    )
Repository: ivy-llc/ivy

Issue:
dropout2d



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/mindspore/ops/function/nn_func.py b/ivy/functional/frontends/mindspore/ops/function/nn_func.py
--- a/ivy/functional/frontends/mindspore/ops/function/nn_func.py
+++ b/ivy/functional/frontends/mindspore/ops/function/nn_func.py
@@ -6,6 +6,23 @@
 from ivy.func_wrapper import with_supported_dtypes
 from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
 
+@with_supported_dtypes(
+    {
+        "2.0.0 and below": (
+            "int8",
+            "int16",
+            "int32",
+            "int64",
+            "float16",
+            "float32",
+            "float64",
+        )
+    },
+    "mindspore",
+)
+@to_ivy_arrays_and_back
+def dropout2d(input, p=0.5, training=True):
+    return ivy.dropout2d(input, p, training=training, data_format="NCHW")
 
 @with_supported_dtypes({"2.0.0 and below": ("float16", "float32")}, "mindspore")
 @to_ivy_arrays_and_back


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py b/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py
--- a/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py
+++ b/ivy_tests/test_ivy/test_frontends/test_mindspore/test_ops/test_function/test_mindspore_nn_func.py
@@ -1,4 +1,5 @@
 # global
+# from hypothesis import strategies as st
 
 # local
 # TODO: uncomment after frontend is not required
@@ -6,6 +7,48 @@
 
 # import ivy_tests.test_ivy.helpers as helpers
 # from ivy_tests.test_ivy.helpers import handle_frontend_test
+#
+# #dropout2d
+# @handle_frontend_test(
+#     fn_tree="mindspore.ops.function.nn_func.dropout2d",
+#     d_type_and_x=helpers.dtype_and_values(
+#         available_dtypes=helpers.get_dtypes("valid"),
+#         num_arrays=1,
+#         shared_dtype=True,
+#         min_value=2,
+#         max_value=5,
+#         min_dim_size=4,
+#         shape=(
+#             st.integers(min_value=2, max_value=10),
+#             4,
+#             st.integers(min_value=12, max_value=64),
+#             st.integers(min_value=12, max_value=64),
+#         ),
+#     ),
+#     p=st.floats(min_value=0.0, max_value=1.0),
+#     training=st.booleans(),
+# )
+# def test_mindspore_dropout2d(
+#     *,
+#     d_type_and_x,
+#     p,
+#     training,
+#     on_device,
+#     fn_tree,
+#     frontend,
+#     test_flags,
+# ):
+#     dtype, x = d_type_and_x
+#     helpers.test_frontend_function(
+#         input_dtypes=dtype,
+#         frontend=frontend,
+#         test_flags=test_flags,
+#         fn_tree=fn_tree,
+#         on_device=on_device,
+#         input=x[0],
+#         p=p,
+#         training=training,
+#     )
 
 
 # selu
Repository: ivy-llc/ivy

Issue:
adjust_brightness
- [ ] #15046 


Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/vision/transforms.py b/ivy/functional/frontends/paddle/vision/transforms.py
--- a/ivy/functional/frontends/paddle/vision/transforms.py
+++ b/ivy/functional/frontends/paddle/vision/transforms.py
@@ -1,4 +1,5 @@
 import ivy
+import ivy.numpy as np
 from ivy.func_wrapper import (
     with_supported_dtypes,
     with_unsupported_device_and_dtypes,
@@ -9,6 +10,25 @@
 )
 
 
+@with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
+# Return the brightness-adjusted image
+def adjust_brightness(img, brightness_factor):
+    # Assuming img is a numpy array or Ivy array
+    if ivy.is_array(img):
+        # Adjust brightness compositionally using ivy.add and ivy.multiply
+        adjusted_img = ivy.add(ivy.multiply(img, brightness_factor), (1 - brightness_factor))
+        return adjusted_img
+    elif isinstance(img, Image.Image):
+        # Convert image to Ivy array
+        img_array = np.array(img)
+        adjusted_img_array = ivy.add(ivy.multiply(img_array, brightness_factor), (1 - brightness_factor))
+        # Convert Ivy array back to image
+        adjusted_img_pil = Image.fromarray(adjusted_img_array.astype('uint8'))
+        return adjusted_img_pil
+    else:
+        raise ValueError("Unsupported input format")
+
+
 @with_supported_dtypes(
     {"2.5.1 and below": ("float32", "float64", "int32", "int64")}, "paddle"
 )


Test patch:
Repository: ivy-llc/ivy

Issue:
topk



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/search.py b/ivy/functional/frontends/paddle/tensor/search.py
--- a/ivy/functional/frontends/paddle/tensor/search.py
+++ b/ivy/functional/frontends/paddle/tensor/search.py
@@ -59,3 +59,12 @@ def searchsorted(sorted_sequence, values, out_int32=False, right=False, name=Non
     if out_int32:
         ret = ivy.astype(ret, "int32")
     return ret
+
+
+@with_supported_dtypes(
+    {"2.5.1 and below": ("float32", "float64", "int32", "int64")},
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def topk(x, k, axis=None, largest=True, sorted=True, name=None):
+    return ivy.top_k(x, k, axis=axis, largest=largest, sorted=sorted)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_search.py
@@ -163,3 +163,45 @@ def test_paddle_searchsorted(
         out_int32=out_int32,
         right=right,
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.topk",
+    dtype_x_and_axis=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_num_dims=1,
+        valid_axis=True,
+        force_int_axis=True,
+    ),
+    k=st.data(),
+    sorted=st.booleans(),
+    largest=st.booleans(),
+)
+def test_paddle_topk(
+    *,
+    dtype_x_and_axis,
+    k,
+    sorted,
+    largest,
+    on_device,
+    fn_tree,
+    frontend,
+    backend_fw,
+    test_flags,
+):
+    input_dtypes, x, axis = dtype_x_and_axis
+    k = k.draw(st.integers(min_value=1, max_value=x[0].shape[axis]))
+    helpers.test_frontend_function(
+        input_dtypes=input_dtypes,
+        frontend=frontend,
+        backend_to_test=backend_fw,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+        k=k,
+        axis=axis,
+        largest=largest,
+        sorted=sorted,
+        test_values=False,
+    )
Repository: ivy-llc/ivy

Issue:
prod



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
@@ -384,3 +384,11 @@ def lerp(x, y, weight, name=None):
 @to_ivy_arrays_and_back
 def rsqrt(x, name=None):
     return 1 / ivy.sqrt(x)
+
+
+@with_supported_dtypes(
+    {"2.5.0 and below": ("float32", "float64", "int32", "int64")}, "paddle"
+)
+@to_ivy_arrays_and_back
+def prod(x, axis=None, keepdim=False, dtype=None, name=None):
+    return ivy.prod(x, axis=axis, keepdims=keepdim, dtype=dtype)


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
@@ -1709,3 +1709,39 @@ def test_paddle_rsqrt(
         on_device=on_device,
         x=x[0],
     )
+
+
+# prod
+@handle_frontend_test(
+    fn_tree="paddle.tensor.math.prod",
+    dtype_and_x=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("numeric"),
+        min_axis=-1,
+        max_axis=0,
+        min_num_dims=1,
+        min_value=-10,
+        max_value=10,
+        force_int_axis=False,
+        allow_nan=False,
+    ),
+)
+def test_paddle_prod(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x, axis = 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],
+        axis=axis,
+        keepdim=False,
+        backend_to_test="paddle",
+    )