prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  median
  
  
  --- 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/tensor/stat.py`
  Content:
  ```
  1 # global
  2 import ivy
  3 from ivy.func_wrapper import with_unsupported_dtypes
  4 from ivy.functional.frontends.paddle.func_wrapper import (
  5     to_ivy_arrays_and_back,
  6 )
  7 
  8 
  9 @with_unsupported_dtypes({"2.5.0 and below": ("float16", "bfloat16")}, "paddle")
  10 @to_ivy_arrays_and_back
  11 def mean(input, axis=None, keepdim=False, out=None):
  12     ret = ivy.mean(input, axis=axis, keepdims=keepdim, out=out)
  13     ret = ivy.expand_dims(ret, axis=-1) if ret.ndim == 0 else ret
  14     return ret
  15 
  16 
  17 @with_unsupported_dtypes({"2.5.0 and below": ("complex", "int8")}, "paddle")
  18 @to_ivy_arrays_and_back
  19 def numel(x, name=None):
  20     prod = ivy.prod(x.size, dtype=ivy.int64)
  21     try:
  22         length = len(x)
  23     except (ValueError, TypeError):
  24         length = 1  # if 0 dimensional tensor with 1 element
  25     return ivy.array([prod if prod > 0 else ivy.array(length, dtype=ivy.int64)])
  26 
  27 
  28 @with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
  29 @to_ivy_arrays_and_back
  30 def nanquantile(a, q, axis=None, keepdims=False, interpolation="linear", out=None):
  31     return ivy.nanquantile(
  32         a, q, axis=axis, keepdims=keepdims, interpolation=interpolation, out=out
  33     )
  34
  ```
  --- 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/tensor/stat.py b/ivy/functional/frontends/paddle/tensor/stat.py
  --- a/ivy/functional/frontends/paddle/tensor/stat.py
  +++ b/ivy/functional/frontends/paddle/tensor/stat.py
  @@ -1,6 +1,6 @@
   # global
   import ivy
  -from ivy.func_wrapper import with_unsupported_dtypes
  +from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
   from ivy.functional.frontends.paddle.func_wrapper import (
       to_ivy_arrays_and_back,
   )
  @@ -31,3 +31,17 @@
       return ivy.nanquantile(
           a, q, axis=axis, keepdims=keepdims, interpolation=interpolation, out=out
       )
  +
  +
  +@with_supported_dtypes(
  +    {"2.5.0 and below": ("bool", "float16", "float32", "float64", "int32", "int64")},
  +    "paddle",
  +)
  +@to_ivy_arrays_and_back
  +def median(x, axis=None, keepdim=False, name=None):
  +    x = (
  +        ivy.astype(x, ivy.float64)
  +        if ivy.dtype(x) == "float64"
  +        else ivy.astype(x, ivy.float32)
  +    )
  +    return ivy.median(x, axis=axis, keepdims=keepdim)
  
verification_info: {"golden_diff": "diff --git a/ivy/functional/frontends/paddle/tensor/stat.py b/ivy/functional/frontends/paddle/tensor/stat.py\n--- a/ivy/functional/frontends/paddle/tensor/stat.py\n+++ b/ivy/functional/frontends/paddle/tensor/stat.py\n@@ -1,6 +1,6 @@\n # global\n import ivy\n-from ivy.func_wrapper import with_unsupported_dtypes\n+from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes\n from ivy.functional.frontends.paddle.func_wrapper import (\n     to_ivy_arrays_and_back,\n )\n@@ -31,3 +31,17 @@\n     return ivy.nanquantile(\n         a, q, axis=axis, keepdims=keepdims, interpolation=interpolation, out=out\n     )\n+\n+\n+@with_supported_dtypes(\n+    {\"2.5.0 and below\": (\"bool\", \"float16\", \"float32\", \"float64\", \"int32\", \"int64\")},\n+    \"paddle\",\n+)\n+@to_ivy_arrays_and_back\n+def median(x, axis=None, keepdim=False, name=None):\n+    x = (\n+        ivy.astype(x, ivy.float64)\n+        if ivy.dtype(x) == \"float64\"\n+        else ivy.astype(x, ivy.float32)\n+    )\n+    return ivy.median(x, axis=axis, keepdims=keepdim)\n", "issue": "median\n\n", "before_files": [{"content": "# global\nimport ivy\nfrom ivy.func_wrapper import with_unsupported_dtypes\nfrom ivy.functional.frontends.paddle.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\n\n\n@with_unsupported_dtypes({\"2.5.0 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef mean(input, axis=None, keepdim=False, out=None):\n    ret = ivy.mean(input, axis=axis, keepdims=keepdim, out=out)\n    ret = ivy.expand_dims(ret, axis=-1) if ret.ndim == 0 else ret\n    return ret\n\n\n@with_unsupported_dtypes({\"2.5.0 and below\": (\"complex\", \"int8\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef numel(x, name=None):\n    prod = ivy.prod(x.size, dtype=ivy.int64)\n    try:\n        length = len(x)\n    except (ValueError, TypeError):\n        length = 1  # if 0 dimensional tensor with 1 element\n    return ivy.array([prod if prod > 0 else ivy.array(length, dtype=ivy.int64)])\n\n\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef nanquantile(a, q, axis=None, keepdims=False, interpolation=\"linear\", out=None):\n    return ivy.nanquantile(\n        a, q, axis=axis, keepdims=keepdims, interpolation=interpolation, out=out\n    )\n", "path": "ivy/functional/frontends/paddle/tensor/stat.py"}], "after_files": [{"content": "# global\nimport ivy\nfrom ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes\nfrom ivy.functional.frontends.paddle.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\n\n\n@with_unsupported_dtypes({\"2.5.0 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef mean(input, axis=None, keepdim=False, out=None):\n    ret = ivy.mean(input, axis=axis, keepdims=keepdim, out=out)\n    ret = ivy.expand_dims(ret, axis=-1) if ret.ndim == 0 else ret\n    return ret\n\n\n@with_unsupported_dtypes({\"2.5.0 and below\": (\"complex\", \"int8\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef numel(x, name=None):\n    prod = ivy.prod(x.size, dtype=ivy.int64)\n    try:\n        length = len(x)\n    except (ValueError, TypeError):\n        length = 1  # if 0 dimensional tensor with 1 element\n    return ivy.array([prod if prod > 0 else ivy.array(length, dtype=ivy.int64)])\n\n\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef nanquantile(a, q, axis=None, keepdims=False, interpolation=\"linear\", out=None):\n    return ivy.nanquantile(\n        a, q, axis=axis, keepdims=keepdims, interpolation=interpolation, out=out\n    )\n\n\n@with_supported_dtypes(\n    {\"2.5.0 and below\": (\"bool\", \"float16\", \"float32\", \"float64\", \"int32\", \"int64\")},\n    \"paddle\",\n)\n@to_ivy_arrays_and_back\ndef median(x, axis=None, keepdim=False, name=None):\n    x = (\n        ivy.astype(x, ivy.float64)\n        if ivy.dtype(x) == \"float64\"\n        else ivy.astype(x, ivy.float32)\n    )\n    return ivy.median(x, axis=axis, keepdims=keepdim)\n", "path": "ivy/functional/frontends/paddle/tensor/stat.py"}]}