prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  dropout3d
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `ivy/functional/frontends/paddle/nn/functional/common.py`
  Content:
  ```
  1 # local
  2 import ivy
  3 from ivy.func_wrapper import with_supported_dtypes
  4 from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
  5 
  6 
  7 @to_ivy_arrays_and_back
  8 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
  9 def cosine_similarity(x1, x2, *, axis=1, eps=1e-08):
  10     if len(x1.shape) == len(x2.shape) and len(x2.shape) >= 2:
  11         numerator = ivy.sum(x1 * x2, axis=axis)
  12         x1_squared_norm = ivy.sum(ivy.square(x1), axis=axis)
  13         x2_squared_norm = ivy.sum(ivy.square(x2), axis=axis)
  14     else:
  15         numerator = ivy.sum(x1 * x2)
  16         x1_squared_norm = ivy.sum(ivy.square(x1))
  17         x2_squared_norm = ivy.sum(ivy.square(x2))
  18 
  19     x1_norm = ivy.sqrt(x1_squared_norm)
  20     x2_norm = ivy.sqrt(x2_squared_norm)
  21     norm_mm = x1_norm * x2_norm
  22     denominator = ivy.maximum(norm_mm, eps)
  23 
  24     cosine = numerator / denominator
  25     return cosine
  26 
  27 
  28 @to_ivy_arrays_and_back
  29 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
  30 def dropout2d(x, *, p=0.5, training=True, data_format="NCHW", name=None):
  31     return ivy.dropout2d(x, p=p, training=training, data_format=data_format)
  32 
  33 
  34 def get_mask(shape, device, prob, seed=None):
  35     mask = ivy.where(
  36         ivy.random_uniform(shape=shape, device=device, seed=seed) < prob,
  37         0.0,
  38         1.0,
  39     )
  40     return mask
  41 
  42 
  43 @to_ivy_arrays_and_back
  44 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
  45 def dropout(x, p=0.5, axis=None, training=True, mode="upscale_in_train", name=None):
  46     if axis > 1:
  47         raise ValueError("Axis value can only be 0 or 1 or None.")
  48     elif axis is None or (isinstance(axis, list) and len(axis) == 2):
  49         mask = get_mask(shape=x.shape, device=ivy.dev(x), prob=p, seed=None)
  50     elif axis == 0:
  51         mask = get_mask(shape=(x.shape[0], 1), device=ivy.dev(x), prob=p)
  52         mask = ivy.broadcast_to(mask, x.shape)
  53     elif axis == 1:
  54         mask = get_mask(shape=(1, x.shape[1]), device=ivy.dev(x), prob=p)
  55         mask = ivy.broadcast_to(mask, x.shape)
  56     if mode == "upscale_in_train":
  57         if training:
  58             out = ivy.multiply(x, mask)
  59             ret = ivy.multiply(out, 1.0 / (1.0 - p))
  60         else:
  61             ret = x
  62     else:
  63         if training:
  64             ret = ivy.multiply(x, mask)
  65         else:
  66             ret = ivy.multiply(x, (1.0 - p))
  67     return ret
  68 
  69 
  70 @to_ivy_arrays_and_back
  71 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
  72 def zeropad2d(x, padding, data_format="NCHW", name=None):
  73     if ivy.is_array(padding):
  74         padding = padding.to_list()
  75     if isinstance(padding, int):
  76         padding = [padding, padding, padding, padding]
  77     if len(padding) != 4:
  78         raise ValueError("Padding length should be 4.")
  79     if x.ndim != 4:
  80         raise ValueError("Input x must be 4-dimensional.")
  81     if data_format == "NCHW":
  82         padding = ((0, 0), (0, 0), (padding[2], padding[3]), (padding[0], padding[1]))
  83     elif data_format == "NHWC":
  84         padding = ((0, 0), (padding[2], padding[3]), (padding[0], padding[1]), (0, 0))
  85     else:
  86         raise ValueError("Unknown data_format: {}".format(data_format))
  87     return ivy.pad(x, padding, mode="constant", constant_values=0.0)
  88 
  89 
  90 @to_ivy_arrays_and_back
  91 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
  92 def interpolate(
  93     x,
  94     size=None,
  95     scale_factor=None,
  96     mode="nearest",
  97     align_corners=False,
  98     align_mode=0,
  99     data_format="NCHW",
  100     name=None,
  101 ):
  102     return ivy.interpolate(
  103         x, size, mode=mode, scale_factor=scale_factor, align_corners=align_corners
  104     )
  105 
  106 
  107 @to_ivy_arrays_and_back
  108 @with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
  109 def linear(x, weight, bias=None, name=None):
  110     weight = ivy.swapaxes(weight, -1, -2)
  111     return ivy.linear(x, weight, bias=bias)
  112
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/ivy/functional/frontends/paddle/nn/functional/common.py b/ivy/functional/frontends/paddle/nn/functional/common.py
  --- a/ivy/functional/frontends/paddle/nn/functional/common.py
  +++ b/ivy/functional/frontends/paddle/nn/functional/common.py
  @@ -109,3 +109,9 @@
   def linear(x, weight, bias=None, name=None):
       weight = ivy.swapaxes(weight, -1, -2)
       return ivy.linear(x, weight, bias=bias)
  +
  +
  +@to_ivy_arrays_and_back
  +@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
  +def dropout3d(x, p=0.5, training=True, data_format="NCDHW", name=None):
  +    return ivy.dropout3d(x, p, training=training, data_format=data_format)
  
verification_info: {"golden_diff": "diff --git a/ivy/functional/frontends/paddle/nn/functional/common.py b/ivy/functional/frontends/paddle/nn/functional/common.py\n--- a/ivy/functional/frontends/paddle/nn/functional/common.py\n+++ b/ivy/functional/frontends/paddle/nn/functional/common.py\n@@ -109,3 +109,9 @@\n def linear(x, weight, bias=None, name=None):\n     weight = ivy.swapaxes(weight, -1, -2)\n     return ivy.linear(x, weight, bias=bias)\n+\n+\n+@to_ivy_arrays_and_back\n+@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\n+def dropout3d(x, p=0.5, training=True, data_format=\"NCDHW\", name=None):\n+    return ivy.dropout3d(x, p, training=training, data_format=data_format)\n", "issue": "dropout3d\n\n", "before_files": [{"content": "# local\nimport ivy\nfrom ivy.func_wrapper import with_supported_dtypes\nfrom ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef cosine_similarity(x1, x2, *, axis=1, eps=1e-08):\n    if len(x1.shape) == len(x2.shape) and len(x2.shape) >= 2:\n        numerator = ivy.sum(x1 * x2, axis=axis)\n        x1_squared_norm = ivy.sum(ivy.square(x1), axis=axis)\n        x2_squared_norm = ivy.sum(ivy.square(x2), axis=axis)\n    else:\n        numerator = ivy.sum(x1 * x2)\n        x1_squared_norm = ivy.sum(ivy.square(x1))\n        x2_squared_norm = ivy.sum(ivy.square(x2))\n\n    x1_norm = ivy.sqrt(x1_squared_norm)\n    x2_norm = ivy.sqrt(x2_squared_norm)\n    norm_mm = x1_norm * x2_norm\n    denominator = ivy.maximum(norm_mm, eps)\n\n    cosine = numerator / denominator\n    return cosine\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef dropout2d(x, *, p=0.5, training=True, data_format=\"NCHW\", name=None):\n    return ivy.dropout2d(x, p=p, training=training, data_format=data_format)\n\n\ndef get_mask(shape, device, prob, seed=None):\n    mask = ivy.where(\n        ivy.random_uniform(shape=shape, device=device, seed=seed) < prob,\n        0.0,\n        1.0,\n    )\n    return mask\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef dropout(x, p=0.5, axis=None, training=True, mode=\"upscale_in_train\", name=None):\n    if axis > 1:\n        raise ValueError(\"Axis value can only be 0 or 1 or None.\")\n    elif axis is None or (isinstance(axis, list) and len(axis) == 2):\n        mask = get_mask(shape=x.shape, device=ivy.dev(x), prob=p, seed=None)\n    elif axis == 0:\n        mask = get_mask(shape=(x.shape[0], 1), device=ivy.dev(x), prob=p)\n        mask = ivy.broadcast_to(mask, x.shape)\n    elif axis == 1:\n        mask = get_mask(shape=(1, x.shape[1]), device=ivy.dev(x), prob=p)\n        mask = ivy.broadcast_to(mask, x.shape)\n    if mode == \"upscale_in_train\":\n        if training:\n            out = ivy.multiply(x, mask)\n            ret = ivy.multiply(out, 1.0 / (1.0 - p))\n        else:\n            ret = x\n    else:\n        if training:\n            ret = ivy.multiply(x, mask)\n        else:\n            ret = ivy.multiply(x, (1.0 - p))\n    return ret\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef zeropad2d(x, padding, data_format=\"NCHW\", name=None):\n    if ivy.is_array(padding):\n        padding = padding.to_list()\n    if isinstance(padding, int):\n        padding = [padding, padding, padding, padding]\n    if len(padding) != 4:\n        raise ValueError(\"Padding length should be 4.\")\n    if x.ndim != 4:\n        raise ValueError(\"Input x must be 4-dimensional.\")\n    if data_format == \"NCHW\":\n        padding = ((0, 0), (0, 0), (padding[2], padding[3]), (padding[0], padding[1]))\n    elif data_format == \"NHWC\":\n        padding = ((0, 0), (padding[2], padding[3]), (padding[0], padding[1]), (0, 0))\n    else:\n        raise ValueError(\"Unknown data_format: {}\".format(data_format))\n    return ivy.pad(x, padding, mode=\"constant\", constant_values=0.0)\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef interpolate(\n    x,\n    size=None,\n    scale_factor=None,\n    mode=\"nearest\",\n    align_corners=False,\n    align_mode=0,\n    data_format=\"NCHW\",\n    name=None,\n):\n    return ivy.interpolate(\n        x, size, mode=mode, scale_factor=scale_factor, align_corners=align_corners\n    )\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef linear(x, weight, bias=None, name=None):\n    weight = ivy.swapaxes(weight, -1, -2)\n    return ivy.linear(x, weight, bias=bias)\n", "path": "ivy/functional/frontends/paddle/nn/functional/common.py"}], "after_files": [{"content": "# local\nimport ivy\nfrom ivy.func_wrapper import with_supported_dtypes\nfrom ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef cosine_similarity(x1, x2, *, axis=1, eps=1e-08):\n    if len(x1.shape) == len(x2.shape) and len(x2.shape) >= 2:\n        numerator = ivy.sum(x1 * x2, axis=axis)\n        x1_squared_norm = ivy.sum(ivy.square(x1), axis=axis)\n        x2_squared_norm = ivy.sum(ivy.square(x2), axis=axis)\n    else:\n        numerator = ivy.sum(x1 * x2)\n        x1_squared_norm = ivy.sum(ivy.square(x1))\n        x2_squared_norm = ivy.sum(ivy.square(x2))\n\n    x1_norm = ivy.sqrt(x1_squared_norm)\n    x2_norm = ivy.sqrt(x2_squared_norm)\n    norm_mm = x1_norm * x2_norm\n    denominator = ivy.maximum(norm_mm, eps)\n\n    cosine = numerator / denominator\n    return cosine\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef dropout2d(x, *, p=0.5, training=True, data_format=\"NCHW\", name=None):\n    return ivy.dropout2d(x, p=p, training=training, data_format=data_format)\n\n\ndef get_mask(shape, device, prob, seed=None):\n    mask = ivy.where(\n        ivy.random_uniform(shape=shape, device=device, seed=seed) < prob,\n        0.0,\n        1.0,\n    )\n    return mask\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef dropout(x, p=0.5, axis=None, training=True, mode=\"upscale_in_train\", name=None):\n    if axis > 1:\n        raise ValueError(\"Axis value can only be 0 or 1 or None.\")\n    elif axis is None or (isinstance(axis, list) and len(axis) == 2):\n        mask = get_mask(shape=x.shape, device=ivy.dev(x), prob=p, seed=None)\n    elif axis == 0:\n        mask = get_mask(shape=(x.shape[0], 1), device=ivy.dev(x), prob=p)\n        mask = ivy.broadcast_to(mask, x.shape)\n    elif axis == 1:\n        mask = get_mask(shape=(1, x.shape[1]), device=ivy.dev(x), prob=p)\n        mask = ivy.broadcast_to(mask, x.shape)\n    if mode == \"upscale_in_train\":\n        if training:\n            out = ivy.multiply(x, mask)\n            ret = ivy.multiply(out, 1.0 / (1.0 - p))\n        else:\n            ret = x\n    else:\n        if training:\n            ret = ivy.multiply(x, mask)\n        else:\n            ret = ivy.multiply(x, (1.0 - p))\n    return ret\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef zeropad2d(x, padding, data_format=\"NCHW\", name=None):\n    if ivy.is_array(padding):\n        padding = padding.to_list()\n    if isinstance(padding, int):\n        padding = [padding, padding, padding, padding]\n    if len(padding) != 4:\n        raise ValueError(\"Padding length should be 4.\")\n    if x.ndim != 4:\n        raise ValueError(\"Input x must be 4-dimensional.\")\n    if data_format == \"NCHW\":\n        padding = ((0, 0), (0, 0), (padding[2], padding[3]), (padding[0], padding[1]))\n    elif data_format == \"NHWC\":\n        padding = ((0, 0), (padding[2], padding[3]), (padding[0], padding[1]), (0, 0))\n    else:\n        raise ValueError(\"Unknown data_format: {}\".format(data_format))\n    return ivy.pad(x, padding, mode=\"constant\", constant_values=0.0)\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef interpolate(\n    x,\n    size=None,\n    scale_factor=None,\n    mode=\"nearest\",\n    align_corners=False,\n    align_mode=0,\n    data_format=\"NCHW\",\n    name=None,\n):\n    return ivy.interpolate(\n        x, size, mode=mode, scale_factor=scale_factor, align_corners=align_corners\n    )\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef linear(x, weight, bias=None, name=None):\n    weight = ivy.swapaxes(weight, -1, -2)\n    return ivy.linear(x, weight, bias=bias)\n\n\n@to_ivy_arrays_and_back\n@with_supported_dtypes({\"2.5.1 and below\": (\"float32\", \"float64\")}, \"paddle\")\ndef dropout3d(x, p=0.5, training=True, data_format=\"NCDHW\", name=None):\n    return ivy.dropout3d(x, p, training=training, data_format=data_format)\n", "path": "ivy/functional/frontends/paddle/nn/functional/common.py"}]}