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

Issue:
fft2



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/scipy/fft/fft.py b/ivy/functional/frontends/scipy/fft/fft.py
--- a/ivy/functional/frontends/scipy/fft/fft.py
+++ b/ivy/functional/frontends/scipy/fft/fft.py
@@ -28,3 +28,8 @@ def dct(x, type=2, n=None, axis=-1, norm=None, overwrite_x=False, orthogonalize=
 def idct(x, type=2, n=None, axis=-1, norm=None, overwrite_x=False, orthogonalize=None):
     inverse_type = {1: 1, 2: 3, 3: 2, 4: 4}[type]
     return ivy.dct(x, type=inverse_type, n=n, axis=axis, norm=norm)
+
+
+@to_ivy_arrays_and_back
+def fft2(x, s=None, axes=(-2, -1), norm=None, overwrite_x=False):
+    return ivy.fft2(x, s=s, dim=axes, norm=norm)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_scipy/test_fft/test_scipy_fft.py b/ivy_tests/test_ivy/test_frontends/test_scipy/test_fft/test_scipy_fft.py
--- a/ivy_tests/test_ivy/test_frontends/test_scipy/test_fft/test_scipy_fft.py
+++ b/ivy_tests/test_ivy/test_frontends/test_scipy/test_fft/test_scipy_fft.py
@@ -106,6 +106,27 @@
 #     return dtype, x, type, n, axis, norm
 
 
+# @st.composite
+# def x_and_fft2(draw):
+#     min_fft2_points = 2
+#     dtype = draw(helpers.get_dtypes("float_and_complex", full=False))
+#     x, dim = draw(
+#         helpers.arrays_and_axes(
+#             available_dtypes=dtype[0],
+#             min_dim_size=2,
+#             max_dim_size=100,
+#             min_num_dims=2,
+#             max_num_dims=4,
+#         ),
+#     )
+#     s = (
+#         draw(st.integers(min_fft2_points, 256)),
+#         draw(st.integers(min_fft2_points, 256)),
+#     )
+#     norm = draw(st.sampled_from(["backward", "forward", "ortho"]))
+#     return dtype, x, s, dim, norm
+
+
 # ### Tests ###
 
 # # fft
@@ -220,3 +241,30 @@
 #         rtol_=1e-3,
 #         atol_=1e-1,
 #     )
+
+
+# # fft2
+# @handle_frontend_test(
+#     fn_tree="scipy.fft.fft2",
+#     d_x_d_s_n=x_and_fft2(),
+#     test_with_out=st.just(False),
+# )
+# def test_fft2(
+#     d_x_d_s_n,
+#     frontend,
+#     test_flags,
+#     fn_tree,
+#     on_device,
+# ):
+#     dtype, x, s, ax, norm = d_x_d_s_n
+#     helpers.test_frontend_function(
+#         input_dtypes=dtype,
+#         frontend=frontend,
+#         test_flags=test_flags,
+#         fn_tree=fn_tree,
+#         on_device=on_device,
+#         x=x[0],
+#         s=s,
+#         axes=ax,
+#         norm=norm,
+#     )
Repository: ivy-llc/ivy

Issue:
grad
Implement `torch.Tensor.grad`


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
This issue is being closed. As this issue has been stalled with no activity for more than 7 days.

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
@@ -27,6 +27,7 @@ def __init__(self, array, device=None, _init_overload=False):
             self._ivy_array = ivy.array(
                 array, dtype=torch_frontend.float32, device=device
             )
+        self._grads = None
 
     def __len__(self):
         return len(self._ivy_array)
@@ -79,6 +80,10 @@ def data(self):
             ivy.stop_gradient(self.ivy_array, preserve_type=False)
         )
 
+    @property
+    def grad(self):
+        return self._grads
+
     # Setters #
     # --------#
 


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
@@ -184,6 +184,13 @@ def test_torch_tensor_property_ndim(
     ivy.utils.assertions.check_equal(x.ndim, data[0].ndim, as_array=False)
 
 
+def test_torch_tensor_property_grad():
+    x = Tensor(ivy.array([1.0, 2.0, 3.0]))
+    grads = ivy.array([1.0, 2.0, 3.0])
+    x._grads = grads
+    assert ivy.array_equal(x.grad, grads)
+
+
 # chunk
 @pytest.mark.skip("Testing takes a lot of time")
 @handle_frontend_method(
Repository: ivy-llc/ivy

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



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/reduction_ops.py b/ivy/functional/frontends/torch/reduction_ops.py
--- a/ivy/functional/frontends/torch/reduction_ops.py
+++ b/ivy/functional/frontends/torch/reduction_ops.py
@@ -54,10 +54,11 @@ def sum(input, dim=None, keepdim=False, *, dtype=None, out=None):
 
 
 @to_ivy_arrays_and_back
-def mean(input, dim=None, axis=None, keepdim=False, *, out=None):
-    if dim is None:
-        dim = axis
-    return ivy.mean(input, axis=dim, keepdims=keepdim, out=out)
+def mean(input, *, dtype=None):
+    if dtype is not None:
+        input = ivy.astype(input, dtype)
+
+    return ivy.mean(input)
 
 
 @to_ivy_arrays_and_back


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_reduction_ops.py
@@ -290,12 +290,12 @@ def test_torch_sum(
         min_value=-1e04,
         max_value=1e04,
     ),
-    keepdims=st.booleans(),
+    dtype=helpers.get_dtypes("float_and_complex", full=False, none=True),
 )
 def test_torch_mean(
     *,
     dtype_and_x,
-    keepdims,
+    dtype,
     on_device,
     fn_tree,
     frontend,
@@ -308,9 +308,9 @@ def test_torch_mean(
         test_flags=test_flags,
         fn_tree=fn_tree,
         on_device=on_device,
+        atol=0.001,
         input=x[0],
-        dim=axis,
-        keepdim=keepdims,
+        dtype=dtype[0],
     )
Repository: ivy-llc/ivy

Issue:
expm1



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
@@ -210,6 +210,12 @@ def exp(x, name=None):
     return ivy.exp(x)
 
 
+@with_supported_dtypes({"2.5.0 and below": ("float16", "float32", "float64")}, "paddle")
+@to_ivy_arrays_and_back
+def expm1(x, name=None):
+    return ivy.expm1(x)
+
+
 @with_supported_dtypes({"2.5.0 and below": ("float32", "float64")}, "paddle")
 @to_ivy_arrays_and_back
 def erf(x, name=None):


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_math.py
@@ -887,6 +887,32 @@ def test_paddle_exp(
     )
 
 
+# expm1
+@handle_frontend_test(
+    fn_tree="paddle.expm1",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+)
+def test_paddle_expm1(
+    *,
+    dtype_and_x,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        x=x[0],
+    )
+
+
 # square
 @handle_frontend_test(
     fn_tree="paddle.tensor.math.square",
Repository: ivy-llc/ivy

Issue:
nonzero



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
@@ -31,3 +31,15 @@ def argmin(x, /, *, axis=None, keepdim=False, dtype="int64", name=None):
 @to_ivy_arrays_and_back
 def argsort(x, /, *, axis=-1, descending=False, name=None):
     return ivy.argsort(x, axis=axis, descending=descending)
+
+
+@with_supported_dtypes(
+    {"2.4.2 and below": ("float32", "float64", "int16", "int32", "int64", "uint8")},
+    "paddle",
+)
+@to_ivy_arrays_and_back
+def nonzero(input, /, *, as_tuple=False):
+    ret = ivy.nonzero(input)
+    if as_tuple is False:
+        ret = ivy.matrix_transpose(ivy.stack(ret))
+    return ret


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_search.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_search.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_search.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_search.py
@@ -96,3 +96,32 @@ def test_paddle_argsort(
         axis=axis,
         descending=descending,
     )
+
+
+# nonzero
+@handle_frontend_test(
+    fn_tree="paddle.nonzero",
+    dtype_and_values=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+    ),
+    as_tuple=st.booleans(),
+)
+def test_paddle_nonzero(
+    *,
+    dtype_and_values,
+    as_tuple,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    dtype, input = dtype_and_values
+    helpers.test_frontend_function(
+        input_dtypes=dtype,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=input[0],
+        as_tuple=as_tuple,
+    )
Repository: ivy-llc/ivy

Issue:
imag
adding imag in paddle tensor.py 



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
@@ -355,3 +355,10 @@ def max(self, axis=None, keepdim=False, name=None):
     @with_unsupported_dtypes({"2.5.0 and below": ("float16", "bfloat16")}, "paddle")
     def deg2rad(self, name=None):
         return ivy.deg2rad(self._ivy_array)
+
+    @with_supported_dtypes(
+        {"2.5.0 and below": ("complex64", "complex128")},
+        "paddle",
+    )
+    def imag(self, name=None):
+        return paddle_frontend.imag(self)


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

Issue:
default_dtype



Discussion:

Resolving patch:
diff --git a/ivy/functional/ivy/data_type.py b/ivy/functional/ivy/data_type.py
--- a/ivy/functional/ivy/data_type.py
+++ b/ivy/functional/ivy/data_type.py
@@ -1181,10 +1181,10 @@ def default_dtype(
     """
     Parameters
     ----------
-    dtype
-        The dtype to be returned.
     item
         Number or array for inferring the dtype.
+    dtype
+        The dtype to be returned.
     as_native
         Whether to return the dtype as native dtype.
 
@@ -1193,6 +1193,39 @@ def default_dtype(
         Return ``dtype`` as native or ivy dtype if provided, else
         if ``item`` is given, return its dtype, otherwise return the
         global default dtype.
+
+    Examples
+    --------
+    >>> ivy.default_dtype()
+    'float32'
+
+    >>> ivy.set_default_dtype(ivy.bool)
+    >>> ivy.default_dtype()
+    'bool'
+
+    >>> ivy.set_default_dtype(ivy.int16)
+    >>> ivy.default_dtype()
+    'int16'
+
+    >>> ivy.set_default_dtype(ivy.float64)
+    >>> ivy.default_dtype()
+    'float64'
+
+    >>> ivy.default_dtype(dtype="int32")
+    'int32'
+
+    >>> ivy.default_dtype(dtype=ivy.float16)
+    'float16'
+
+    >>> ivy.default_dtype(item=53.234)
+    'float64'
+
+    >>> ivy.default_dtype(item=[1, 2, 3])
+    'int32'
+
+    >>> x = ivy.array([5.2, 9.7], dtype="complex128")
+    >>> ivy.default_dtype(item=x)
+    'complex128'
     """
     if ivy.exists(dtype):
         if as_native is True:


Test patch:
Repository: ivy-llc/ivy

Issue:
isclose
adding isclose in paddle tensor.py


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
@@ -366,6 +366,20 @@ def imag(self, name=None):
     def is_tensor(self):
         return paddle_frontend.is_tensor(self._ivy_array)
 
+    @with_supported_dtypes(
+        {
+            "2.5.0 and below": (
+                "float32",
+                "float64",
+            )
+        },
+        "paddle",
+    )
+    def isclose(self, y, rtol=1e-05, atol=1e-08, equal_nan=False, name=None):
+        return paddle_frontend.isclose(
+            self, y, rtol=rtol, atol=atol, equal_nan=equal_nan
+        )
+    
     @with_supported_dtypes({"2.5.0 and below": ("int32", "int64")}, "paddle")
     def floor_divide(self, y, name=None):
         y_ivy = y._ivy_array if isinstance(y, Tensor) else _to_ivy_array(y)


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_paddle_tensor.py
@@ -1922,3 +1922,34 @@ def test_paddle_is_tensor(
         frontend=frontend,
         on_device=on_device,
     )
+
+
+# isclose
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="paddle.to_tensor",
+    method_name="isclose",
+    dtypes_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"), num_arrays=2, shared_dtype=True
+    ),
+)
+def test_paddle_isclose(
+    dtypes_and_x,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+    frontend,
+    on_device,
+):
+    input_dtype, x = dtypes_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        init_all_as_kwargs_np={"data": x[0]},
+        method_input_dtypes=input_dtype,
+        method_all_as_kwargs_np={"y": x[1]},
+        frontend_method_data=frontend_method_data,
+        init_flags=init_flags,
+        method_flags=method_flags,
+        frontend=frontend,
+        on_device=on_device,
+    )
Repository: ivy-llc/ivy

Issue:
sigmoid



Discussion:

Resolving patch:
diff --git a/ivy/functional/ivy/activations.py b/ivy/functional/ivy/activations.py
--- a/ivy/functional/ivy/activations.py
+++ b/ivy/functional/ivy/activations.py
@@ -426,6 +426,7 @@ def sigmoid(
     -------
     ret
         an array containing the sigmoid activation of each element in ``x``.
+        sigmoid activation of x is defined as 1/(1+exp(-x)).
 
     Examples
     --------
@@ -437,15 +438,41 @@ def sigmoid(
     ivy.array([0.269, 0.731, 0.881])
 
     >>> x = ivy.array([-1.0, 1.0, 2.0])
-    >>> y = x.sigmoid()
+    >>> y = ivy.zeros(3)
+    >>> ivy.sigmoid(x,out=y)
     >>> print(y)
     ivy.array([0.269, 0.731, 0.881])
+    
+    With :class:`ivy.Container` input:
 
-
-    >>> x = ivy.array([[-1.3, 3.8, 2.1], [1.7, 4.2, -6.6]])
+    >>> x = ivy.Container(a=ivy.array([0.]),
+                          b=ivy.Container(c=ivy.array([1.]),
+                                          d=ivy.array([2.])))
     >>> y = ivy.sigmoid(x)
     >>> print(y)
-    ivy.array([[0.214, 0.978, 0.891], [0.846,0.985,0.001]] )
+    {
+        a: ivy.array([0.]),
+        b: {
+            c: ivy.array([1.]),
+            d: ivy.array([2.])
+        }
+    }
+
+    >>> x = ivy.Container(a=ivy.array([0.]),
+                          b=ivy.Container(c=ivy.array([1.]),
+                                          d=ivy.array([2.]))))
+    >>> y = ivy.Container(a=ivy.array([0.]),
+                          b=ivy.Container(c=ivy.array([0.]),
+                                          d=ivy.array([0.]))))
+    >>> ivy.sigmoid(x,out=y)
+    >>> print(y)
+    {
+        a: ivy.array([0.]),
+        b: {
+            c: ivy.array([1.]),
+            d: ivy.array([2.])
+        }
+    }
     """
     return current_backend(x).sigmoid(x, out=out)
 


Test patch:
Repository: ivy-llc/ivy

Issue:
conjugate



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/jax/devicearray.py b/ivy/functional/frontends/jax/devicearray.py
--- a/ivy/functional/frontends/jax/devicearray.py
+++ b/ivy/functional/frontends/jax/devicearray.py
@@ -67,6 +67,9 @@ def argmax(
     def conj(self, /):
         return jax_frontend.numpy.conj(self._ivy_array)
 
+    def conjugate(self, /):
+        return jax_frontend.numpy.conjugate(self._ivy_array)
+
     def mean(self, *, axis=None, dtype=None, out=None, keepdims=False, where=None):
         return jax_frontend.numpy.mean(
             self._ivy_array,


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_devicearray.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_devicearray.py
--- a/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_devicearray.py
+++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_jax_devicearray.py
@@ -200,6 +200,38 @@ def test_jax_devicearray_conj(
     )
 
 
+@handle_frontend_method(
+    class_tree=CLASS_TREE,
+    init_tree="jax.numpy.array",
+    method_name="conjugate",
+    dtype_and_x=helpers.dtype_values_axis(
+        available_dtypes=helpers.get_dtypes("real_and_complex"),
+    ),
+)
+def test_jax_devicearray_conjugate(
+    dtype_and_x,
+    on_device,
+    frontend,
+    frontend_method_data,
+    init_flags,
+    method_flags,
+):
+    input_dtype, x, axis = dtype_and_x
+    helpers.test_frontend_method(
+        init_input_dtypes=input_dtype,
+        init_all_as_kwargs_np={
+            "object": x[0],
+        },
+        method_input_dtypes=input_dtype,
+        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,
+    )
+
+
 @handle_frontend_method(
     class_tree=CLASS_TREE,
     init_tree="jax.numpy.array",
Repository: ivy-llc/ivy

Issue:
dropout3d



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/torch/nn/functional/dropout_functions.py b/ivy/functional/frontends/torch/nn/functional/dropout_functions.py
--- a/ivy/functional/frontends/torch/nn/functional/dropout_functions.py
+++ b/ivy/functional/frontends/torch/nn/functional/dropout_functions.py
@@ -17,3 +17,13 @@ def dropout1d(input, p=0.5, training=True, inplace=False):
     if inplace:
         return ivy.dropout1d(input, p, training=training, data_format="NCW", out=input)
     return ivy.dropout1d(input, p, training=training, data_format="NCW")
+
+
+@to_ivy_arrays_and_back
+@with_unsupported_dtypes({"2.0.1 and below": ("float16", "bfloat16")}, "torch")
+def dropout3d(input, p=0.5, training=True, inplace=False):
+    if inplace:
+        return ivy.dropout3d(
+            input, p, training=training, data_format="NDHWC", out=input
+        )
+    return ivy.dropout3d(input, p, training=training, data_format="NDHWC")


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_dropout_functions.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_dropout_functions.py
--- a/ivy_tests/test_ivy/test_frontends/test_torch/test_dropout_functions.py
+++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_dropout_functions.py
@@ -95,3 +95,48 @@ def test_torch_dropout1d(
     for u in ret:
         # cardinality test
         assert u.shape == x.shape
+
+
+@handle_frontend_test(
+    fn_tree="torch.nn.functional.dropout3d",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("float"),
+        min_value=0,
+        max_value=50,
+        allow_inf=False,
+        min_num_dims=4,
+        max_num_dims=5,
+        min_dim_size=2,
+    ),
+    prob=helpers.floats(min_value=0, max_value=0.9),
+    training=st.booleans(),
+    test_with_out=st.just(True),
+    test_inplace=st.just(False),
+)
+def test_torch_dropout3d(
+    *,
+    dtype_and_x,
+    prob,
+    training,
+    on_device,
+    fn_tree,
+    frontend,
+    test_flags,
+):
+    input_dtype, x = dtype_and_x
+    ret = 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],
+        p=prob,
+        training=training,
+        test_values=False,
+    )
+    ret = helpers.flatten_and_to_np(ret=ret)
+    x = np.asarray(x[0], input_dtype[0])
+    for u in ret:
+        # cardinality test
+        assert u.shape == x.shape