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


--- 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/torch/nn/functional/pooling_functions.py`
Content:
```
1 # global
2 from functools import reduce
3 
4 # local
5 import ivy
6 from ivy import with_unsupported_dtypes
7 from ivy.functional.frontends.torch.func_wrapper import (
8     to_ivy_arrays_and_back,
9 )
10 
11 
12 # --- Helpers --- #
13 # --------------- #
14 
15 
16 def _broadcast_pooling_helper(x, pool_dims: str = "2d", name: str = "padding"):
17     dims = {"1d": 1, "2d": 2, "3d": 3}
18 
19     if isinstance(x, int):
20         return tuple([x for _ in range(dims[pool_dims])])
21 
22     if len(x) == 1:
23         return tuple([x[0] for _ in range(dims[pool_dims])])
24     elif len(x) == dims[pool_dims]:
25         return tuple(x)
26     elif len(x) != dims[pool_dims]:
27         raise ValueError(
28             f"`{name}` must either be a single int, "
29             f"or a tuple of {dims[pool_dims]} ints. "
30         )
31 
32 
33 # --- Main --- #
34 # ------------ #
35 
36 
37 @with_unsupported_dtypes(
38     {
39         "2.0.1 and below": (
40             "bfloat16",
41             "float16",
42         )
43     },
44     "torch",
45 )
46 @to_ivy_arrays_and_back
47 def adaptive_avg_pool1d(input, output_size):
48     return ivy.adaptive_avg_pool1d(input, output_size)
49 
50 
51 @with_unsupported_dtypes(
52     {
53         "2.0.1 and below": (
54             "float16",
55             "bfloat16",
56         )
57     },
58     "torch",
59 )
60 @to_ivy_arrays_and_back
61 def adaptive_avg_pool2d(input, output_size):
62     return ivy.adaptive_avg_pool2d(input, output_size)
63 
64 
65 @to_ivy_arrays_and_back
66 def adaptive_max_pool2d(
67     input,
68     output_size,
69     return_indices=False,
70 ):
71     # ToDo: Add return_indices once superset is implemented
72     return ivy.adaptive_max_pool2d(input, output_size)
73 
74 
75 @to_ivy_arrays_and_back
76 def avg_pool1d(
77     input,
78     kernel_size,
79     stride=None,
80     padding=0,
81     ceil_mode=False,
82     count_include_pad=True,
83 ):
84     if stride is None:
85         stride = kernel_size
86     data_format = "NCW"
87     # TODO: remove the broadcasting and padding string specification when ivy.avg_pool
88     #   support explicit padding
89     kernel_size = _broadcast_pooling_helper(kernel_size, "1d", name="kernel_size")
90     padding = _broadcast_pooling_helper(padding, "1d", name="padding")
91     if all(
92         [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]
93     ):
94         padding = "SAME"
95     else:
96         padding = "VALID"
97     return ivy.avg_pool1d(
98         input,
99         kernel_size,
100         stride,
101         padding,
102         data_format=data_format,
103         count_include_pad=count_include_pad,
104         ceil_mode=ceil_mode,
105     )
106 
107 
108 @to_ivy_arrays_and_back
109 def avg_pool2d(
110     input,
111     kernel_size,
112     stride=None,
113     padding=0,
114     ceil_mode=False,
115     count_include_pad=True,
116     divisor_override=None,
117 ):
118     if stride is None:
119         stride = kernel_size
120     data_format = "NCHW"
121     # TODO: remove the broadcasting and padding string specification when ivy.avg_pool
122     #   support explicit padding
123     kernel_size = _broadcast_pooling_helper(kernel_size, "2d", name="kernel_size")
124     padding = _broadcast_pooling_helper(padding, "2d", name="padding")
125     if all(
126         [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]
127     ):
128         padding = "SAME"
129     else:
130         padding = "VALID"
131     return ivy.avg_pool2d(
132         input,
133         kernel_size,
134         stride,
135         padding,
136         data_format=data_format,
137         ceil_mode=ceil_mode,
138         count_include_pad=count_include_pad,
139         divisor_override=divisor_override,
140     )
141 
142 
143 @to_ivy_arrays_and_back
144 def avg_pool3d(
145     input,
146     kernel_size,
147     stride=None,
148     padding=0,
149     ceil_mode=False,
150     count_include_pad=True,
151     divisor_override=None,
152 ):
153     if stride is None:
154         stride = kernel_size
155     # TODO: remove the broadcasting and padding string specification when ivy.avg_pool
156     #   support explicit padding
157     kernel_size = _broadcast_pooling_helper(kernel_size, "3d", name="kernel_size")
158     padding = _broadcast_pooling_helper(padding, "3d", name="padding")
159     if all(
160         [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]
161     ):
162         padding = "SAME"
163     else:
164         padding = "VALID"
165     return ivy.avg_pool3d(
166         input,
167         kernel_size,
168         stride,
169         padding,
170         data_format="NCDHW",
171         ceil_mode=ceil_mode,
172         count_include_pad=count_include_pad,
173         divisor_override=divisor_override,
174     )
175 
176 
177 @with_unsupported_dtypes(
178     {
179         "2.0.1 and below": (
180             "float16",
181             "bfloat16",
182         )
183     },
184     "torch",
185 )
186 @to_ivy_arrays_and_back
187 def lp_pool1d(input, norm_type, kernel_size, stride=None, ceil_mode=False):
188     data_format = "NCW"
189     padding = "VALID"
190     if stride is None:
191         stride = kernel_size
192     if not isinstance(kernel_size, int):
193         kernel_mul = reduce(lambda x, y: x * y, kernel_size)
194     else:
195         kernel_mul = kernel_size
196 
197     out = ivy.avg_pool1d(
198         ivy.pow(input, norm_type),
199         kernel_size,
200         stride,
201         padding,
202         data_format=data_format,
203         ceil_mode=ceil_mode,
204     )
205     p = 1.0 / norm_type if norm_type != 0 else 1.0
206     return ivy.pow(ivy.multiply(out, kernel_mul), p)
207 
208 
209 @to_ivy_arrays_and_back
210 def lp_pool2d(input, norm_type, kernel_size, stride=None, ceil_mode=False):
211     data_format = "NCHW"
212     padding = "VALID"
213     if stride is None:
214         stride = kernel_size
215     out = ivy.avg_pool2d(
216         ivy.pow(input, norm_type),
217         kernel_size,
218         stride,
219         padding,
220         data_format=data_format,
221         ceil_mode=ceil_mode,
222     )
223     if not isinstance(kernel_size, int):
224         kernel_mul = reduce(lambda x, y: x * y, kernel_size)
225     else:
226         kernel_mul = kernel_size
227     p = ivy.divide(1.0, norm_type) if norm_type != 0 else 1.0
228     return ivy.pow(ivy.multiply(out, kernel_mul), p).astype(input.dtype)
229 
230 
231 @to_ivy_arrays_and_back
232 def max_pool1d(
233     input,
234     kernel_size,
235     stride=None,
236     padding=0,
237     ceil_mode=False,
238     dilation=1,
239     return_indices=False,
240 ):
241     if stride is None:
242         stride = kernel_size
243     data_format = "NCW"
244     return ivy.max_pool1d(
245         input,
246         kernel_size,
247         stride,
248         padding,
249         data_format=data_format,
250         dilation=dilation,
251         ceil_mode=ceil_mode,
252     )
253 
254 
255 @with_unsupported_dtypes({"2.0.1 and below": ("float16",)}, "torch")
256 @to_ivy_arrays_and_back
257 def max_pool2d(
258     input,
259     kernel_size,
260     stride=None,
261     padding=0,
262     dilation=1,
263     ceil_mode=False,
264     return_indices=False,
265 ):
266     if stride is None:
267         stride = kernel_size
268     return ivy.max_pool2d(
269         input,
270         kernel_size,
271         stride,
272         padding,
273         data_format="NCHW",
274         dilation=dilation,
275         ceil_mode=ceil_mode,
276     )
277
```
--- 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/torch/nn/functional/pooling_functions.py b/ivy/functional/frontends/torch/nn/functional/pooling_functions.py
--- a/ivy/functional/frontends/torch/nn/functional/pooling_functions.py
+++ b/ivy/functional/frontends/torch/nn/functional/pooling_functions.py
@@ -274,3 +274,28 @@
         dilation=dilation,
         ceil_mode=ceil_mode,
     )
+
+
+@with_unsupported_dtypes({"2.0.1 and below": ("float16",)}, "torch")
+@to_ivy_arrays_and_back
+def max_pool3d(
+    input,
+    kernel_size,
+    stride=None,
+    padding=0,
+    dilation=1,
+    ceil_mode=False,
+    return_indices=False,
+):
+    if stride is None:
+        stride = kernel_size
+
+    return ivy.max_pool3d(
+        input,
+        kernel_size,
+        stride,
+        padding,
+        data_format="NCDHW",
+        dilation=dilation,
+        ceil_mode=ceil_mode,
+    )

{"golden_diff": "diff --git a/ivy/functional/frontends/torch/nn/functional/pooling_functions.py b/ivy/functional/frontends/torch/nn/functional/pooling_functions.py\n--- a/ivy/functional/frontends/torch/nn/functional/pooling_functions.py\n+++ b/ivy/functional/frontends/torch/nn/functional/pooling_functions.py\n@@ -274,3 +274,28 @@\n         dilation=dilation,\n         ceil_mode=ceil_mode,\n     )\n+\n+\n+@with_unsupported_dtypes({\"2.0.1 and below\": (\"float16\",)}, \"torch\")\n+@to_ivy_arrays_and_back\n+def max_pool3d(\n+    input,\n+    kernel_size,\n+    stride=None,\n+    padding=0,\n+    dilation=1,\n+    ceil_mode=False,\n+    return_indices=False,\n+):\n+    if stride is None:\n+        stride = kernel_size\n+\n+    return ivy.max_pool3d(\n+        input,\n+        kernel_size,\n+        stride,\n+        padding,\n+        data_format=\"NCDHW\",\n+        dilation=dilation,\n+        ceil_mode=ceil_mode,\n+    )\n", "issue": "max_pool3d\n\n", "before_files": [{"content": "# global\nfrom functools import reduce\n\n# local\nimport ivy\nfrom ivy import with_unsupported_dtypes\nfrom ivy.functional.frontends.torch.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\n\n\n# --- Helpers --- #\n# --------------- #\n\n\ndef _broadcast_pooling_helper(x, pool_dims: str = \"2d\", name: str = \"padding\"):\n    dims = {\"1d\": 1, \"2d\": 2, \"3d\": 3}\n\n    if isinstance(x, int):\n        return tuple([x for _ in range(dims[pool_dims])])\n\n    if len(x) == 1:\n        return tuple([x[0] for _ in range(dims[pool_dims])])\n    elif len(x) == dims[pool_dims]:\n        return tuple(x)\n    elif len(x) != dims[pool_dims]:\n        raise ValueError(\n            f\"`{name}` must either be a single int, \"\n            f\"or a tuple of {dims[pool_dims]} ints. \"\n        )\n\n\n# --- Main --- #\n# ------------ #\n\n\n@with_unsupported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"bfloat16\",\n            \"float16\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef adaptive_avg_pool1d(input, output_size):\n    return ivy.adaptive_avg_pool1d(input, output_size)\n\n\n@with_unsupported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float16\",\n            \"bfloat16\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef adaptive_avg_pool2d(input, output_size):\n    return ivy.adaptive_avg_pool2d(input, output_size)\n\n\n@to_ivy_arrays_and_back\ndef adaptive_max_pool2d(\n    input,\n    output_size,\n    return_indices=False,\n):\n    # ToDo: Add return_indices once superset is implemented\n    return ivy.adaptive_max_pool2d(input, output_size)\n\n\n@to_ivy_arrays_and_back\ndef avg_pool1d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    count_include_pad=True,\n):\n    if stride is None:\n        stride = kernel_size\n    data_format = \"NCW\"\n    # TODO: remove the broadcasting and padding string specification when ivy.avg_pool\n    #   support explicit padding\n    kernel_size = _broadcast_pooling_helper(kernel_size, \"1d\", name=\"kernel_size\")\n    padding = _broadcast_pooling_helper(padding, \"1d\", name=\"padding\")\n    if all(\n        [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]\n    ):\n        padding = \"SAME\"\n    else:\n        padding = \"VALID\"\n    return ivy.avg_pool1d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        count_include_pad=count_include_pad,\n        ceil_mode=ceil_mode,\n    )\n\n\n@to_ivy_arrays_and_back\ndef avg_pool2d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    count_include_pad=True,\n    divisor_override=None,\n):\n    if stride is None:\n        stride = kernel_size\n    data_format = \"NCHW\"\n    # TODO: remove the broadcasting and padding string specification when ivy.avg_pool\n    #   support explicit padding\n    kernel_size = _broadcast_pooling_helper(kernel_size, \"2d\", name=\"kernel_size\")\n    padding = _broadcast_pooling_helper(padding, \"2d\", name=\"padding\")\n    if all(\n        [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]\n    ):\n        padding = \"SAME\"\n    else:\n        padding = \"VALID\"\n    return ivy.avg_pool2d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        ceil_mode=ceil_mode,\n        count_include_pad=count_include_pad,\n        divisor_override=divisor_override,\n    )\n\n\n@to_ivy_arrays_and_back\ndef avg_pool3d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    count_include_pad=True,\n    divisor_override=None,\n):\n    if stride is None:\n        stride = kernel_size\n    # TODO: remove the broadcasting and padding string specification when ivy.avg_pool\n    #   support explicit padding\n    kernel_size = _broadcast_pooling_helper(kernel_size, \"3d\", name=\"kernel_size\")\n    padding = _broadcast_pooling_helper(padding, \"3d\", name=\"padding\")\n    if all(\n        [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]\n    ):\n        padding = \"SAME\"\n    else:\n        padding = \"VALID\"\n    return ivy.avg_pool3d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=\"NCDHW\",\n        ceil_mode=ceil_mode,\n        count_include_pad=count_include_pad,\n        divisor_override=divisor_override,\n    )\n\n\n@with_unsupported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float16\",\n            \"bfloat16\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef lp_pool1d(input, norm_type, kernel_size, stride=None, ceil_mode=False):\n    data_format = \"NCW\"\n    padding = \"VALID\"\n    if stride is None:\n        stride = kernel_size\n    if not isinstance(kernel_size, int):\n        kernel_mul = reduce(lambda x, y: x * y, kernel_size)\n    else:\n        kernel_mul = kernel_size\n\n    out = ivy.avg_pool1d(\n        ivy.pow(input, norm_type),\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        ceil_mode=ceil_mode,\n    )\n    p = 1.0 / norm_type if norm_type != 0 else 1.0\n    return ivy.pow(ivy.multiply(out, kernel_mul), p)\n\n\n@to_ivy_arrays_and_back\ndef lp_pool2d(input, norm_type, kernel_size, stride=None, ceil_mode=False):\n    data_format = \"NCHW\"\n    padding = \"VALID\"\n    if stride is None:\n        stride = kernel_size\n    out = ivy.avg_pool2d(\n        ivy.pow(input, norm_type),\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        ceil_mode=ceil_mode,\n    )\n    if not isinstance(kernel_size, int):\n        kernel_mul = reduce(lambda x, y: x * y, kernel_size)\n    else:\n        kernel_mul = kernel_size\n    p = ivy.divide(1.0, norm_type) if norm_type != 0 else 1.0\n    return ivy.pow(ivy.multiply(out, kernel_mul), p).astype(input.dtype)\n\n\n@to_ivy_arrays_and_back\ndef max_pool1d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    dilation=1,\n    return_indices=False,\n):\n    if stride is None:\n        stride = kernel_size\n    data_format = \"NCW\"\n    return ivy.max_pool1d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        dilation=dilation,\n        ceil_mode=ceil_mode,\n    )\n\n\n@with_unsupported_dtypes({\"2.0.1 and below\": (\"float16\",)}, \"torch\")\n@to_ivy_arrays_and_back\ndef max_pool2d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    dilation=1,\n    ceil_mode=False,\n    return_indices=False,\n):\n    if stride is None:\n        stride = kernel_size\n    return ivy.max_pool2d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=\"NCHW\",\n        dilation=dilation,\n        ceil_mode=ceil_mode,\n    )\n", "path": "ivy/functional/frontends/torch/nn/functional/pooling_functions.py"}], "after_files": [{"content": "# global\nfrom functools import reduce\n\n# local\nimport ivy\nfrom ivy import with_unsupported_dtypes\nfrom ivy.functional.frontends.torch.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\n\n\n# --- Helpers --- #\n# --------------- #\n\n\ndef _broadcast_pooling_helper(x, pool_dims: str = \"2d\", name: str = \"padding\"):\n    dims = {\"1d\": 1, \"2d\": 2, \"3d\": 3}\n\n    if isinstance(x, int):\n        return tuple([x for _ in range(dims[pool_dims])])\n\n    if len(x) == 1:\n        return tuple([x[0] for _ in range(dims[pool_dims])])\n    elif len(x) == dims[pool_dims]:\n        return tuple(x)\n    elif len(x) != dims[pool_dims]:\n        raise ValueError(\n            f\"`{name}` must either be a single int, \"\n            f\"or a tuple of {dims[pool_dims]} ints. \"\n        )\n\n\n# --- Main --- #\n# ------------ #\n\n\n@with_unsupported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"bfloat16\",\n            \"float16\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef adaptive_avg_pool1d(input, output_size):\n    return ivy.adaptive_avg_pool1d(input, output_size)\n\n\n@with_unsupported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float16\",\n            \"bfloat16\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef adaptive_avg_pool2d(input, output_size):\n    return ivy.adaptive_avg_pool2d(input, output_size)\n\n\n@to_ivy_arrays_and_back\ndef adaptive_max_pool2d(\n    input,\n    output_size,\n    return_indices=False,\n):\n    # ToDo: Add return_indices once superset is implemented\n    return ivy.adaptive_max_pool2d(input, output_size)\n\n\n@to_ivy_arrays_and_back\ndef avg_pool1d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    count_include_pad=True,\n):\n    if stride is None:\n        stride = kernel_size\n    data_format = \"NCW\"\n    # TODO: remove the broadcasting and padding string specification when ivy.avg_pool\n    #   support explicit padding\n    kernel_size = _broadcast_pooling_helper(kernel_size, \"1d\", name=\"kernel_size\")\n    padding = _broadcast_pooling_helper(padding, \"1d\", name=\"padding\")\n    if all(\n        [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]\n    ):\n        padding = \"SAME\"\n    else:\n        padding = \"VALID\"\n    return ivy.avg_pool1d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        count_include_pad=count_include_pad,\n        ceil_mode=ceil_mode,\n    )\n\n\n@to_ivy_arrays_and_back\ndef avg_pool2d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    count_include_pad=True,\n    divisor_override=None,\n):\n    if stride is None:\n        stride = kernel_size\n    data_format = \"NCHW\"\n    # TODO: remove the broadcasting and padding string specification when ivy.avg_pool\n    #   support explicit padding\n    kernel_size = _broadcast_pooling_helper(kernel_size, \"2d\", name=\"kernel_size\")\n    padding = _broadcast_pooling_helper(padding, \"2d\", name=\"padding\")\n    if all(\n        [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]\n    ):\n        padding = \"SAME\"\n    else:\n        padding = \"VALID\"\n    return ivy.avg_pool2d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        ceil_mode=ceil_mode,\n        count_include_pad=count_include_pad,\n        divisor_override=divisor_override,\n    )\n\n\n@to_ivy_arrays_and_back\ndef avg_pool3d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    count_include_pad=True,\n    divisor_override=None,\n):\n    if stride is None:\n        stride = kernel_size\n    # TODO: remove the broadcasting and padding string specification when ivy.avg_pool\n    #   support explicit padding\n    kernel_size = _broadcast_pooling_helper(kernel_size, \"3d\", name=\"kernel_size\")\n    padding = _broadcast_pooling_helper(padding, \"3d\", name=\"padding\")\n    if all(\n        [pad == ivy.ceil((kernel - 1) / 2) for kernel, pad in zip(kernel_size, padding)]\n    ):\n        padding = \"SAME\"\n    else:\n        padding = \"VALID\"\n    return ivy.avg_pool3d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=\"NCDHW\",\n        ceil_mode=ceil_mode,\n        count_include_pad=count_include_pad,\n        divisor_override=divisor_override,\n    )\n\n\n@with_unsupported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float16\",\n            \"bfloat16\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef lp_pool1d(input, norm_type, kernel_size, stride=None, ceil_mode=False):\n    data_format = \"NCW\"\n    padding = \"VALID\"\n    if stride is None:\n        stride = kernel_size\n    if not isinstance(kernel_size, int):\n        kernel_mul = reduce(lambda x, y: x * y, kernel_size)\n    else:\n        kernel_mul = kernel_size\n\n    out = ivy.avg_pool1d(\n        ivy.pow(input, norm_type),\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        ceil_mode=ceil_mode,\n    )\n    p = 1.0 / norm_type if norm_type != 0 else 1.0\n    return ivy.pow(ivy.multiply(out, kernel_mul), p)\n\n\n@to_ivy_arrays_and_back\ndef lp_pool2d(input, norm_type, kernel_size, stride=None, ceil_mode=False):\n    data_format = \"NCHW\"\n    padding = \"VALID\"\n    if stride is None:\n        stride = kernel_size\n    out = ivy.avg_pool2d(\n        ivy.pow(input, norm_type),\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        ceil_mode=ceil_mode,\n    )\n    if not isinstance(kernel_size, int):\n        kernel_mul = reduce(lambda x, y: x * y, kernel_size)\n    else:\n        kernel_mul = kernel_size\n    p = ivy.divide(1.0, norm_type) if norm_type != 0 else 1.0\n    return ivy.pow(ivy.multiply(out, kernel_mul), p).astype(input.dtype)\n\n\n@to_ivy_arrays_and_back\ndef max_pool1d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    ceil_mode=False,\n    dilation=1,\n    return_indices=False,\n):\n    if stride is None:\n        stride = kernel_size\n    data_format = \"NCW\"\n    return ivy.max_pool1d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=data_format,\n        dilation=dilation,\n        ceil_mode=ceil_mode,\n    )\n\n\n@with_unsupported_dtypes({\"2.0.1 and below\": (\"float16\",)}, \"torch\")\n@to_ivy_arrays_and_back\ndef max_pool2d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    dilation=1,\n    ceil_mode=False,\n    return_indices=False,\n):\n    if stride is None:\n        stride = kernel_size\n    return ivy.max_pool2d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=\"NCHW\",\n        dilation=dilation,\n        ceil_mode=ceil_mode,\n    )\n\n\n@with_unsupported_dtypes({\"2.0.1 and below\": (\"float16\",)}, \"torch\")\n@to_ivy_arrays_and_back\ndef max_pool3d(\n    input,\n    kernel_size,\n    stride=None,\n    padding=0,\n    dilation=1,\n    ceil_mode=False,\n    return_indices=False,\n):\n    if stride is None:\n        stride = kernel_size\n\n    return ivy.max_pool3d(\n        input,\n        kernel_size,\n        stride,\n        padding,\n        data_format=\"NCDHW\",\n        dilation=dilation,\n        ceil_mode=ceil_mode,\n    )\n", "path": "ivy/functional/frontends/torch/nn/functional/pooling_functions.py"}]}