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

Issue:
indices



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/numpy/indexing.py b/ivy/functional/frontends/jax/numpy/indexing.py
--- a/ivy/functional/frontends/jax/numpy/indexing.py
+++ b/ivy/functional/frontends/jax/numpy/indexing.py
@@ -80,3 +80,19 @@ def diag_indices_from(arr):
         raise ValueError("All dimensions of input must be of equal length")
     idx = ivy.arange(n, dtype=int)
     return (idx,) * ndim
+
+
+@to_ivy_arrays_and_back
+def indices(dimensions, dtype=int, sparse=False):
+    if sparse:
+        return tuple(
+            ivy.arange(dim)
+            .expand_dims(
+                axis=[j for j in range(len(dimensions)) if i != j],
+            )
+            .astype(dtype)
+            for i, dim in enumerate(dimensions)
+        )
+    else:
+        grid = ivy.meshgrid(*[ivy.arange(dim) for dim in dimensions], indexing="ij")
+        return ivy.stack(grid, axis=0).astype(dtype)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py
@@ -428,3 +428,34 @@ def test_jax_diag_indices_from(
         on_device=on_device,
         arr=x[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="jax.numpy.indices",
+    dimensions=helpers.get_shape(min_num_dims=1),
+    dtype=helpers.get_dtypes("numeric"),
+    sparse=st.booleans(),
+    test_with_out=st.just(False),
+)
+def test_jax_numpy_indices(
+    *,
+    dimensions,
+    dtype,
+    sparse,
+    test_flags,
+    frontend,
+    backend_fw,
+    fn_tree,
+    on_device,
+):
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        backend_to_test=backend_fw,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        dimensions=dimensions,
+        dtype=dtype[0],
+        sparse=sparse,
+    )
Repository: ivy-llc/ivy

Issue:
numpy.einsum



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/numpy/__init__.py b/ivy/functional/frontends/numpy/__init__.py
--- a/ivy/functional/frontends/numpy/__init__.py
+++ b/ivy/functional/frontends/numpy/__init__.py
@@ -625,6 +625,7 @@ def promote_types_of_numpy_inputs(
 from ivy.functional.frontends.numpy.linalg.matrix_and_vector_products import (
     _matmul,
     dot,
+    einsum,
 )
 
 from ivy.functional.frontends.numpy.mathematical_functions.extrema_finding import (
diff --git a/ivy/functional/frontends/numpy/linalg/matrix_and_vector_products.py b/ivy/functional/frontends/numpy/linalg/matrix_and_vector_products.py
--- a/ivy/functional/frontends/numpy/linalg/matrix_and_vector_products.py
+++ b/ivy/functional/frontends/numpy/linalg/matrix_and_vector_products.py
@@ -75,3 +75,17 @@ def multi_dot(arrays, *, out=None):
 def dot(a, b, out=None):
     a, b = promote_types_of_numpy_inputs(a, b)
     return ivy.matmul(a, b)
+
+
+@handle_numpy_out
+@to_ivy_arrays_and_back
+def einsum(
+    subscripts,
+    *operands,
+    out=None,
+    dtype=None,
+    order="K",
+    casting="safe",
+    optimize=False,
+):
+    return ivy.einsum(subscripts, *operands, out=out)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_linalg/test_matrix_and_vector_products.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_linalg/test_matrix_and_vector_products.py
--- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_linalg/test_matrix_and_vector_products.py
+++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_linalg/test_matrix_and_vector_products.py
@@ -1,5 +1,6 @@
 # global
 from hypothesis import strategies as st
+import numpy as np
 
 # local
 import ivy_tests.test_ivy.helpers as helpers
@@ -369,3 +370,51 @@ def test_numpy_dot(
         a=a,
         b=b,
     )
+
+
+# einsum
+@handle_frontend_test(
+    fn_tree="numpy.einsum",
+    args=st.sampled_from(
+        [
+            (
+                "ii",
+                np.arange(25).reshape(5, 5),
+            ),
+            (
+                "ii->i",
+                np.arange(25).reshape(5, 5),
+            ),
+            ("ij,j", np.arange(25).reshape(5, 5), np.arange(5)),
+        ]
+    ),
+    dtype=helpers.get_dtypes("float", full=False),
+)
+def test_numpy_einsum(
+    *,
+    args,
+    dtype,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+):
+    kw = {}
+    i = 0
+    for arg in args:
+        kw[f"x{i}"] = arg
+        i += 1
+    test_flags.num_positional_args = i
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        test_flags=test_flags,
+        **kw,
+        optimize=False,
+        order="K",
+        casting="safe",
+    )
Repository: ivy-llc/ivy

Issue:
LogSigmoid
#19745


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
- [ ] #19745
Still avilable? can I take it?

Resolving patch:
diff --git a/ivy/stateful/activations.py b/ivy/stateful/activations.py
--- a/ivy/stateful/activations.py
+++ b/ivy/stateful/activations.py
@@ -402,3 +402,24 @@ def _forward(self, x, alpha=1.0):
             The outputs following the ELU activation *[batch_shape, d]*
         """
         return ivy.elu(x, alpha=alpha)
+
+
+class LogSigmoid(Module):
+    def __init__(self):
+        """Apply the LogSigmoid activation function."""
+        Module.__init__(self)
+
+    def _forward(self, x):
+        """
+
+        Parameters
+        ----------
+        x
+            Inputs to process *[batch_shape, d]*.
+
+        Returns
+        -------
+        ret
+            The outputs following the LogSigmoid activation *[batch_shape, d]*
+        """
+        return ivy.logsigmoid(x)


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
@@ -756,3 +756,47 @@ def test_elu(
         test_gradients=test_gradients,
         on_device=on_device,
     )
+
+
+# Logsigmoid
+@handle_method(
+    method_tree="stateful.activations.LogSigmoid.__call__",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        large_abs_safety_factor=8,
+        small_abs_safety_factor=8,
+        safety_factor_scale="log",
+        min_num_dims=2,
+    ),
+    method_num_positional_args=helpers.num_positional_args(
+        fn_name="LogSigmoid._forward"
+    ),
+    test_gradients=st.just(True),
+)
+def test_logsigmoid(
+    *,
+    dtype_and_x,
+    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]},
+        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:
vflip



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,5 +1,8 @@
 import ivy
-from ivy.func_wrapper import with_supported_dtypes
+from ivy.func_wrapper import (
+    with_supported_dtypes,
+    with_unsupported_device_and_dtypes,
+)
 from ..tensor.tensor import Tensor
 from ivy.functional.frontends.paddle.func_wrapper import (
     to_ivy_arrays_and_back,
@@ -13,3 +16,20 @@
 def to_tensor(pic, data_format="CHW"):
     array = ivy.array(pic)
     return Tensor(array)
+
+
+@with_unsupported_device_and_dtypes(
+    {
+        "2.5.1 and below": {
+            "cpu": ("int8", "uint8", "int16", "float16", "bfloat16", "bool")
+        }
+    },
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def vflip(img, data_format="CHW"):
+    if data_format.lower() == "chw":
+        axis = -2
+    elif data_format.lower() == "hwc":
+        axis = -3
+    return ivy.flip(img, axis=axis)


Test patch:
diff --git a/ivy_tests/array_api_testing/test_array_api b/ivy_tests/array_api_testing/test_array_api
--- a/ivy_tests/array_api_testing/test_array_api
+++ b/ivy_tests/array_api_testing/test_array_api
@@ -1 +1 @@
-Subproject commit 852a1ddfedb14742ec94a9dfc6b3f3d4e89d0189
+Subproject commit d2d43a7261dd496d125dcb7318cae3c95f532a80
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_vision/test_transforms.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_vision/test_transforms.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_vision/test_transforms.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_vision/test_transforms.py
@@ -29,3 +29,32 @@ def test_paddle_to_tensor(
         on_device=on_device,
         pic=input[0],
     )
+
+
+@handle_frontend_test(
+    fn_tree="paddle.vision.transforms.vflip",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        min_num_dims=3,
+        max_num_dims=4,
+    ),
+)
+def test_paddle_vflip(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    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,
+        img=x[0],
+        backend_to_test=backend_fw,
+    )
Repository: ivy-llc/ivy

Issue:
fast_gelu
- [fast_gelu] #21500


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
@@ -54,8 +54,19 @@ def selu(input_x):
 def softsign(x):
     return ivy.divide(x, ivy.add(1, ivy.abs(x)))
 
+
 @with_supported_dtypes(
-    {"2.0.0 and below": ("int8", "int16", "int32", "int64", "float16", "float32", "float64")},
+    {
+        "2.0.0 and below": (
+            "int8",
+            "int16",
+            "int32",
+            "int64",
+            "float16",
+            "float32",
+            "float64",
+        )
+    },
     "mindspore",
 )
 @to_ivy_arrays_and_back
@@ -63,7 +74,6 @@ def dropout3d(input, p=0.5, training=True):
     return ivy.dropout3d(input, p, training=training, data_format="NCDHW")
 
 
-
 @with_supported_dtypes(
     {
         "2.0.0 and below": (
@@ -169,3 +179,14 @@ def avg_pool2d(
         count_include_pad=count_include_pad,
         divisor_override=divisor_override,
     )
+
+
+@with_supported_dtypes(
+    {"2.0.0 and below": ("float16", "float32", "float64")},
+    "mindspore",
+)
+@to_ivy_arrays_and_back
+def fast_gelu(input_x):
+    return (input_x / (1 + ivy.exp(-1.702 * ivy.abs(input_x)))) * ivy.exp(
+        0.851 * (input_x - ivy.abs(input_x))
+    )


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
@@ -360,3 +360,29 @@
 #         count_include_pad=count_include_pad,
 #         divisor_override=None,
 #     )
+
+# FastGelu
+# @handle_frontend_test(
+#     fn_tree="mindspore.ops.function.nn_func.fast_gelu",
+#     dtype_and_x=helpers.dtype_and_values(
+#         available_dtypes=helpers.get_dtypes("float"),
+#     ),
+# )
+# def test_mindspore_fast_gelu(
+#     dtype_and_x,
+#     *,
+#     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,
+#         fn_tree=fn_tree,
+#         on_device=on_device,
+#         input=x[0],
+#     )
Repository: ivy-llc/ivy

Issue:
soft shrink



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
@@ -388,6 +388,14 @@ def fast_gelu(input_x):
     )
 
 
+@with_supported_dtypes({"2.0.0 and below": ("float32", "float64")}, "mindspore")
+@to_ivy_arrays_and_back
+def softshrink(x, lambd=0.5):
+    low = ivy.where(ivy.less(input, -lambd), ivy.add(input, lambd), 0)
+    up = ivy.where(ivy.greater(input, lambd), ivy.subtract(input, lambd), 0)
+    return ivy.add(low, up)
+
+
 @with_supported_dtypes({"2.0.0 and below": ("float16", "float32")}, "mindspore")
 @to_ivy_arrays_and_back
 def gumbel_softmax(logits, tau=1, hard=False, dim=-1):


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,5 +1,5 @@
 # global
-# from hypothesis import strategies as st
+# from hypothesis import assume, strategies as st
 
 # local
 # TODO: uncomment after frontend is not required
@@ -429,6 +429,37 @@
 #     )
 
 
+# # softshrink
+# @handle_frontend_test(
+#     fn_tree="mindspore.ops.function.nn_func.softshrink",
+#     dtype_and_input=helpers.dtype_and_values(
+#         available_dtypes=helpers.get_dtypes("valid"),
+#     ),
+#     lambd=helpers.floats(min_value=0, max_value=1, exclude_min=True),
+# )
+# def test_mindspore_softshrink(
+#     *,
+#     dtype_and_input,
+#     lambd,
+#     on_device,
+#     fn_tree,
+#     frontend,
+#     test_flags,
+#     backend_fw,
+# ):
+#     input_dtype, x = 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,
+#         x=x[0],
+#         lambd=lambd,
+#     )
+
+
 # gumbel_softmax
 # @handle_frontend_test(
 #     fn_tree="mindspore.ops.function.nn_func.gumbel_softmax",
Repository: ivy-llc/ivy

Issue:
Take



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
@@ -428,3 +428,27 @@ def diff(x, n=1, axis=-1, prepend=None, append=None, name=None):
 @to_ivy_arrays_and_back
 def mm(input, mat2, name=None):
     return ivy.matmul(input, mat2)
+
+
+@with_supported_dtypes(
+    {"2.5.1 and below": ("float32", "float64", "int32", "int6")}, "paddle"
+)
+@to_ivy_arrays_and_back
+def take(
+    x,
+    index,
+    mode="raise",
+    name=None,
+):
+    if mode not in ["raise", "wrap", "clip"]:
+        raise ValueError(
+            "'mode' in 'take' should be 'raise', 'wrap', 'clip', but received {}."
+            .format(mode)
+        )
+    x = ivy.reshape(x, (-1,))
+    if mode == "clip":
+        index = ivy.clip(index, 0, x.shape[-1] - 1)
+    elif mode == "wrap":
+        index = ivy.where(index < 0, index % x.shape[-1], index)
+        index = ivy.where(index >= x.shape[-1], index % x.shape[-1], index)
+    return ivy.gather(x, index, axis=0)


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
@@ -1926,3 +1926,47 @@ def test_paddle_kron(
         x=x[0],
         y=x[1],
     )
+
+
+@st.composite
+def _test_paddle_take_helper(draw):
+    mode = draw(st.sampled_from(["raise", "clip", "wrap"]))
+
+    safe_bounds = mode == "raise"
+
+    dtypes, xs, indices, _, _ = draw(
+        helpers.array_indices_axis(
+            array_dtypes=helpers.get_dtypes("float_and_integer"),
+            indices_dtypes=["int32", "int64"],
+            valid_bounds=safe_bounds,
+        )
+    )
+
+    return dtypes, xs, indices, mode
+
+
+# take
+@handle_frontend_test(
+    fn_tree="paddle.take", dtype_and_values=_test_paddle_take_helper()
+)
+def test_paddle_take(
+    *,
+    dtype_and_values,
+    on_device,
+    fn_tree,
+    backend_fw,
+    frontend,
+    test_flags,
+):
+    dtypes, xs, indices, modes = dtype_and_values
+    helpers.test_frontend_function(
+        input_dtypes=dtypes,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=xs,
+        index=indices,
+        mode=modes,
+    )
Repository: ivy-llc/ivy

Issue:
 take_along_axis



Discussion:

Resolving patch:
diff --git a/ivy/functional/backends/paddle/experimental/manipulation.py b/ivy/functional/backends/paddle/experimental/manipulation.py
--- a/ivy/functional/backends/paddle/experimental/manipulation.py
+++ b/ivy/functional/backends/paddle/experimental/manipulation.py
@@ -8,6 +8,7 @@
 import paddle
 import ivy
 import ivy.functional.backends.paddle as paddle_backend
+from ivy.func_wrapper import with_supported_device_and_dtypes
 
 # Code from cephes for i0
 
@@ -403,6 +404,10 @@ def atleast_3d(
     {"2.5.1 and below": {"cpu": ("int8",)}},
     backend_version,
 )
+@with_supported_device_and_dtypes(
+    {"2.5.1 and below": {"cpu": ("int32", "int64", "float32", "float64")}},
+    backend_version,
+)
 def take_along_axis(
     arr: paddle.Tensor,
     indices: paddle.Tensor,
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
@@ -132,3 +132,19 @@ def gather(params, indices, axis=-1, batch_dims=0, name=None):
 @to_ivy_arrays_and_back
 def roll(x, shifts, axis=None, name=None):
     return ivy.roll(x, shifts, axis=axis)
+
+
+@with_supported_dtypes(
+    {
+        "2.5.1 and below": (
+            "float32",
+            "float64",
+            "int32",
+            "int64",
+        )
+    },
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def take_along_axis(arr, indices, axis):
+    return ivy.take_along_axis(arr, indices, axis)


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
@@ -601,3 +601,39 @@ def test_paddle_roll(
         shifts=shift,
         axis=axis,
     )
+
+
+# take_along_axis
+@handle_frontend_test(
+    fn_tree="paddle.take_along_axis",
+    dtype_indices_axis=helpers.array_indices_axis(
+        array_dtypes=helpers.get_dtypes(kind="valid"),
+        indices_dtypes=["int64"],
+        min_num_dims=1,
+        max_num_dims=5,
+        min_dim_size=1,
+        max_dim_size=10,
+        indices_same_dims=True,
+    ),
+)
+def test_paddle_take_along_axis(
+    *,
+    dtype_indices_axis,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+    backend_fw,
+):
+    input_dtypes, value, indices, axis, _ = dtype_indices_axis
+    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,
+        arr=value,
+        indices=indices,
+        axis=axis,
+    )
Repository: ivy-llc/ivy

Issue:
standard_t
Implement `standard_t` function for `numpy frontend` task


Discussion:

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
@@ -217,6 +217,14 @@ def standard_normal(size=None):
     return ivy.random_normal(mean=0.0, std=1.0, shape=size, dtype="float64")
 
 
+@to_ivy_arrays_and_back
+@from_zero_dim_arrays_to_scalar
+def standard_t(df, size=None):
+    numerator = ivy.random_normal(mean=0.0, std=1.0, shape=size, dtype="float64")
+    denominator = ivy.gamma(df / 2, 1.0, shape=size, dtype="float64")
+    return ivy.sqrt(df / 2) * ivy.divide(numerator, ivy.sqrt(denominator))
+
+
 @to_ivy_arrays_and_back
 @from_zero_dim_arrays_to_scalar
 def triangular(left, mode, right, size=None):


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
@@ -882,6 +882,41 @@ def test_numpy_standard_normal(
     )
 
 
+# standard_t
+@handle_frontend_test(
+    fn_tree="numpy.random.standard_t",
+    df=st.floats(min_value=1, max_value=20),
+    df_dtypes=helpers.get_dtypes("integer", full=False),
+    size=st.tuples(
+        st.integers(min_value=2, max_value=5), st.integers(min_value=2, max_value=5)
+    ),
+    size_dtypes=helpers.get_dtypes("integer", full=False),
+    test_with_out=st.just(False),
+)
+def test_numpy_standard_t(
+    df,
+    df_dtypes,
+    size,
+    size_dtypes,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+):
+    helpers.test_frontend_function(
+        input_dtypes=df_dtypes + size_dtypes,
+        backend_to_test=backend_fw,
+        test_flags=test_flags,
+        frontend=frontend,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        test_values=False,
+        df=df,
+        size=size,
+    )
+
+
 @handle_frontend_test(
     fn_tree="numpy.random.triangular",
     input_dtypes=helpers.get_dtypes("float"),