We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ihfft


--- 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/numpy/fft/discrete_fourier_transform.py`
Content:
```
1 import ivy
2 from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back
3 from ivy.func_wrapper import with_unsupported_dtypes
4 
5 
6 @to_ivy_arrays_and_back
7 def ifft(a, n=None, axis=-1, norm=None):
8     a = ivy.array(a, dtype=ivy.complex128)
9     if norm is None:
10         norm = "backward"
11     return ivy.ifft(a, axis, norm=norm, n=n)
12 
13 
14 @to_ivy_arrays_and_back
15 @with_unsupported_dtypes({"1.24.3 and below": ("float16",)}, "numpy")
16 def ifftshift(x, axes=None):
17     x = ivy.asarray(x)
18 
19     if axes is None:
20         axes = tuple(range(x.ndim))
21         shift = [-(dim // 2) for dim in x.shape]
22     elif isinstance(
23         axes,
24         (int, type(ivy.uint8), type(ivy.uint16), type(ivy.uint32), type(ivy.uint64)),
25     ):
26         shift = -(x.shape[axes] // 2)
27     else:
28         shift = [-(x.shape[ax] // 2) for ax in axes]
29 
30     roll = ivy.roll(x, shift, axis=axes)
31 
32     return roll
33 
34 
35 @to_ivy_arrays_and_back
36 def fft(a, n=None, axis=-1, norm=None):
37     return ivy.fft(ivy.astype(a, ivy.complex128), axis, norm=norm, n=n)
38 
39 
40 @to_ivy_arrays_and_back
41 @with_unsupported_dtypes({"1.24.3 and below": ("float16",)}, "numpy")
42 def fftshift(x, axes=None):
43     x = ivy.asarray(x)
44 
45     if axes is None:
46         axes = tuple(range(x.ndim))
47         shift = [(dim // 2) for dim in x.shape]
48     elif isinstance(
49         axes,
50         (int, type(ivy.uint8), type(ivy.uint16), type(ivy.uint32), type(ivy.uint64)),
51     ):
52         shift = x.shape[axes] // 2
53     else:
54         shift = [(x.shape[ax] // 2) for ax in axes]
55 
56     roll = ivy.roll(x, shift, axis=axes)
57 
58     return roll
59 
60 
61 @with_unsupported_dtypes({"1.9.0 and below": ("float16",)}, "torch")
62 @to_ivy_arrays_and_back
63 def rfft(a, n=None, axis=-1, norm=None):
64     if norm is None:
65         norm = "backward"
66     a = ivy.array(a, dtype=ivy.float64)
67     return ivy.dft(a, axis=axis, inverse=False, onesided=True, dft_length=n, norm=norm)
68 
69 
70 @with_unsupported_dtypes({"2.4.2 and below": ("int",)}, "paddle")
71 @to_ivy_arrays_and_back
72 def fftfreq(n, d=1.0):
73     if not isinstance(
74         n, (int, type(ivy.int8), type(ivy.int16), type(ivy.int32), type(ivy.int64))
75     ):
76         raise ValueError("n should be an integer")
77 
78     N = (n - 1) // 2 + 1
79     val = 1.0 / (n * d)
80     results = ivy.empty(tuple([n]), dtype=int)
81 
82     p1 = ivy.arange(0, N, dtype=int)
83     results[:N] = p1
84     p2 = ivy.arange(-(n // 2), 0, dtype=int)
85     results[N:] = p2
86 
87     return results * val
88
```
--- 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()

```

diff --git a/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py b/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py
--- a/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py
+++ b/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py
@@ -3,6 +3,23 @@
 from ivy.func_wrapper import with_unsupported_dtypes
 
 
+_SWAP_DIRECTION_MAP = {
+    None: "forward",
+    "backward": "forward",
+    "ortho": "ortho",
+    "forward": "backward",
+}
+
+
+def _swap_direction(norm):
+    try:
+        return _SWAP_DIRECTION_MAP[norm]
+    except KeyError:
+        raise ValueError(
+            f'Invalid norm value {norm}; should be "backward", "ortho" or "forward".'
+        ) from None
+
+
 @to_ivy_arrays_and_back
 def ifft(a, n=None, axis=-1, norm=None):
     a = ivy.array(a, dtype=ivy.complex128)
@@ -67,6 +84,17 @@
     return ivy.dft(a, axis=axis, inverse=False, onesided=True, dft_length=n, norm=norm)
 
 
+@to_ivy_arrays_and_back
+@with_unsupported_dtypes({"1.12.0 and below": ("float16",)}, "numpy")
+def ihfft(a, n=None, axis=-1, norm=None):
+    a = ivy.array(a, dtype=ivy.float64)
+    if n is None:
+        n = a.shape[axis]
+    norm = _swap_direction(norm)
+    output = ivy.conj(rfft(a, n, axis, norm=norm).ivy_array)
+    return output
+
+
 @with_unsupported_dtypes({"2.4.2 and below": ("int",)}, "paddle")
 @to_ivy_arrays_and_back
 def fftfreq(n, d=1.0):

{"golden_diff": "diff --git a/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py b/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py\n--- a/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py\n+++ b/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py\n@@ -3,6 +3,23 @@\n from ivy.func_wrapper import with_unsupported_dtypes\n \n \n+_SWAP_DIRECTION_MAP = {\n+    None: \"forward\",\n+    \"backward\": \"forward\",\n+    \"ortho\": \"ortho\",\n+    \"forward\": \"backward\",\n+}\n+\n+\n+def _swap_direction(norm):\n+    try:\n+        return _SWAP_DIRECTION_MAP[norm]\n+    except KeyError:\n+        raise ValueError(\n+            f'Invalid norm value {norm}; should be \"backward\", \"ortho\" or \"forward\".'\n+        ) from None\n+\n+\n @to_ivy_arrays_and_back\n def ifft(a, n=None, axis=-1, norm=None):\n     a = ivy.array(a, dtype=ivy.complex128)\n@@ -67,6 +84,17 @@\n     return ivy.dft(a, axis=axis, inverse=False, onesided=True, dft_length=n, norm=norm)\n \n \n+@to_ivy_arrays_and_back\n+@with_unsupported_dtypes({\"1.12.0 and below\": (\"float16\",)}, \"numpy\")\n+def ihfft(a, n=None, axis=-1, norm=None):\n+    a = ivy.array(a, dtype=ivy.float64)\n+    if n is None:\n+        n = a.shape[axis]\n+    norm = _swap_direction(norm)\n+    output = ivy.conj(rfft(a, n, axis, norm=norm).ivy_array)\n+    return output\n+\n+\n @with_unsupported_dtypes({\"2.4.2 and below\": (\"int\",)}, \"paddle\")\n @to_ivy_arrays_and_back\n def fftfreq(n, d=1.0):\n", "issue": "ihfft\n\n", "before_files": [{"content": "import ivy\nfrom ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back\nfrom ivy.func_wrapper import with_unsupported_dtypes\n\n\n@to_ivy_arrays_and_back\ndef ifft(a, n=None, axis=-1, norm=None):\n    a = ivy.array(a, dtype=ivy.complex128)\n    if norm is None:\n        norm = \"backward\"\n    return ivy.ifft(a, axis, norm=norm, n=n)\n\n\n@to_ivy_arrays_and_back\n@with_unsupported_dtypes({\"1.24.3 and below\": (\"float16\",)}, \"numpy\")\ndef ifftshift(x, axes=None):\n    x = ivy.asarray(x)\n\n    if axes is None:\n        axes = tuple(range(x.ndim))\n        shift = [-(dim // 2) for dim in x.shape]\n    elif isinstance(\n        axes,\n        (int, type(ivy.uint8), type(ivy.uint16), type(ivy.uint32), type(ivy.uint64)),\n    ):\n        shift = -(x.shape[axes] // 2)\n    else:\n        shift = [-(x.shape[ax] // 2) for ax in axes]\n\n    roll = ivy.roll(x, shift, axis=axes)\n\n    return roll\n\n\n@to_ivy_arrays_and_back\ndef fft(a, n=None, axis=-1, norm=None):\n    return ivy.fft(ivy.astype(a, ivy.complex128), axis, norm=norm, n=n)\n\n\n@to_ivy_arrays_and_back\n@with_unsupported_dtypes({\"1.24.3 and below\": (\"float16\",)}, \"numpy\")\ndef fftshift(x, axes=None):\n    x = ivy.asarray(x)\n\n    if axes is None:\n        axes = tuple(range(x.ndim))\n        shift = [(dim // 2) for dim in x.shape]\n    elif isinstance(\n        axes,\n        (int, type(ivy.uint8), type(ivy.uint16), type(ivy.uint32), type(ivy.uint64)),\n    ):\n        shift = x.shape[axes] // 2\n    else:\n        shift = [(x.shape[ax] // 2) for ax in axes]\n\n    roll = ivy.roll(x, shift, axis=axes)\n\n    return roll\n\n\n@with_unsupported_dtypes({\"1.9.0 and below\": (\"float16\",)}, \"torch\")\n@to_ivy_arrays_and_back\ndef rfft(a, n=None, axis=-1, norm=None):\n    if norm is None:\n        norm = \"backward\"\n    a = ivy.array(a, dtype=ivy.float64)\n    return ivy.dft(a, axis=axis, inverse=False, onesided=True, dft_length=n, norm=norm)\n\n\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"int\",)}, \"paddle\")\n@to_ivy_arrays_and_back\ndef fftfreq(n, d=1.0):\n    if not isinstance(\n        n, (int, type(ivy.int8), type(ivy.int16), type(ivy.int32), type(ivy.int64))\n    ):\n        raise ValueError(\"n should be an integer\")\n\n    N = (n - 1) // 2 + 1\n    val = 1.0 / (n * d)\n    results = ivy.empty(tuple([n]), dtype=int)\n\n    p1 = ivy.arange(0, N, dtype=int)\n    results[:N] = p1\n    p2 = ivy.arange(-(n // 2), 0, dtype=int)\n    results[N:] = p2\n\n    return results * val\n", "path": "ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py"}], "after_files": [{"content": "import ivy\nfrom ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back\nfrom ivy.func_wrapper import with_unsupported_dtypes\n\n\n_SWAP_DIRECTION_MAP = {\n    None: \"forward\",\n    \"backward\": \"forward\",\n    \"ortho\": \"ortho\",\n    \"forward\": \"backward\",\n}\n\n\ndef _swap_direction(norm):\n    try:\n        return _SWAP_DIRECTION_MAP[norm]\n    except KeyError:\n        raise ValueError(\n            f'Invalid norm value {norm}; should be \"backward\", \"ortho\" or \"forward\".'\n        ) from None\n\n\n@to_ivy_arrays_and_back\ndef ifft(a, n=None, axis=-1, norm=None):\n    a = ivy.array(a, dtype=ivy.complex128)\n    if norm is None:\n        norm = \"backward\"\n    return ivy.ifft(a, axis, norm=norm, n=n)\n\n\n@to_ivy_arrays_and_back\n@with_unsupported_dtypes({\"1.24.3 and below\": (\"float16\",)}, \"numpy\")\ndef ifftshift(x, axes=None):\n    x = ivy.asarray(x)\n\n    if axes is None:\n        axes = tuple(range(x.ndim))\n        shift = [-(dim // 2) for dim in x.shape]\n    elif isinstance(\n        axes,\n        (int, type(ivy.uint8), type(ivy.uint16), type(ivy.uint32), type(ivy.uint64)),\n    ):\n        shift = -(x.shape[axes] // 2)\n    else:\n        shift = [-(x.shape[ax] // 2) for ax in axes]\n\n    roll = ivy.roll(x, shift, axis=axes)\n\n    return roll\n\n\n@to_ivy_arrays_and_back\ndef fft(a, n=None, axis=-1, norm=None):\n    return ivy.fft(ivy.astype(a, ivy.complex128), axis, norm=norm, n=n)\n\n\n@to_ivy_arrays_and_back\n@with_unsupported_dtypes({\"1.24.3 and below\": (\"float16\",)}, \"numpy\")\ndef fftshift(x, axes=None):\n    x = ivy.asarray(x)\n\n    if axes is None:\n        axes = tuple(range(x.ndim))\n        shift = [(dim // 2) for dim in x.shape]\n    elif isinstance(\n        axes,\n        (int, type(ivy.uint8), type(ivy.uint16), type(ivy.uint32), type(ivy.uint64)),\n    ):\n        shift = x.shape[axes] // 2\n    else:\n        shift = [(x.shape[ax] // 2) for ax in axes]\n\n    roll = ivy.roll(x, shift, axis=axes)\n\n    return roll\n\n\n@with_unsupported_dtypes({\"1.9.0 and below\": (\"float16\",)}, \"torch\")\n@to_ivy_arrays_and_back\ndef rfft(a, n=None, axis=-1, norm=None):\n    if norm is None:\n        norm = \"backward\"\n    a = ivy.array(a, dtype=ivy.float64)\n    return ivy.dft(a, axis=axis, inverse=False, onesided=True, dft_length=n, norm=norm)\n\n\n@to_ivy_arrays_and_back\n@with_unsupported_dtypes({\"1.12.0 and below\": (\"float16\",)}, \"numpy\")\ndef ihfft(a, n=None, axis=-1, norm=None):\n    a = ivy.array(a, dtype=ivy.float64)\n    if n is None:\n        n = a.shape[axis]\n    norm = _swap_direction(norm)\n    output = ivy.conj(rfft(a, n, axis, norm=norm).ivy_array)\n    return output\n\n\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"int\",)}, \"paddle\")\n@to_ivy_arrays_and_back\ndef fftfreq(n, d=1.0):\n    if not isinstance(\n        n, (int, type(ivy.int8), type(ivy.int16), type(ivy.int32), type(ivy.int64))\n    ):\n        raise ValueError(\"n should be an integer\")\n\n    N = (n - 1) // 2 + 1\n    val = 1.0 / (n * d)\n    results = ivy.empty(tuple([n]), dtype=int)\n\n    p1 = ivy.arange(0, N, dtype=int)\n    results[:N] = p1\n    p2 = ivy.arange(-(n // 2), 0, dtype=int)\n    results[N:] = p2\n\n    return results * val\n", "path": "ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py"}]}