prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  adaptive_avg_pool2d
  Close #20804
  
  </issue>
  <code>
  [start of ivy/functional/frontends/mindspore/ops/function/nn_func.py]
  1 """Includes Mindspore Frontend functions listed in the TODO list
  2 https://github.com/unifyai/ivy/issues/14951."""
  3 
  4 # local
  5 import ivy
  6 from ivy.func_wrapper import with_supported_dtypes
  7 from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
  8 
  9 
  10 @with_supported_dtypes(
  11     {
  12         "2.0.0 and below": (
  13             "int8",
  14             "int16",
  15             "int32",
  16             "int64",
  17             "float16",
  18             "float32",
  19             "float64",
  20         )
  21     },
  22     "mindspore",
  23 )
  24 @to_ivy_arrays_and_back
  25 def dropout2d(input, p=0.5, training=True):
  26     return ivy.dropout2d(input, p, training=training, data_format="NCHW")
  27 
  28 
  29 @with_supported_dtypes({"2.0.0 and below": ("float16", "float32")}, "mindspore")
  30 @to_ivy_arrays_and_back
  31 def selu(input_x):
  32     return ivy.selu(input_x)
  33 
  34 
  35 @with_supported_dtypes({"2.0 and below": ("float16", "float32")}, "mindspore")
  36 @to_ivy_arrays_and_back
  37 def softsign(x):
  38     return ivy.divide(x, ivy.add(1, ivy.abs(x)))
  39 
  40 @with_supported_dtypes({"2.0 and below": ("int8", "int16", "int32", "int64", "float16", "float32", "float64")}, "mindspore")
  41 @to_ivy_arrays_and_back
  42 def pad(input, pad_width, mode='constant', constant_values=0):
  43     return ivy.pad(input, pad_width, mode=mode, constant_values=constant_values)
  [end of ivy/functional/frontends/mindspore/ops/function/nn_func.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/ivy/functional/frontends/mindspore/ops/function/nn_func.py b/ivy/functional/frontends/mindspore/ops/function/nn_func.py
  --- a/ivy/functional/frontends/mindspore/ops/function/nn_func.py
  +++ b/ivy/functional/frontends/mindspore/ops/function/nn_func.py
  @@ -40,4 +40,10 @@
   @with_supported_dtypes({"2.0 and below": ("int8", "int16", "int32", "int64", "float16", "float32", "float64")}, "mindspore")
   @to_ivy_arrays_and_back
   def pad(input, pad_width, mode='constant', constant_values=0):
  -    return ivy.pad(input, pad_width, mode=mode, constant_values=constant_values)
  \ No newline at end of file
  +    return ivy.pad(input, pad_width, mode=mode, constant_values=constant_values)
  +
  +
  +@with_supported_dtypes({"2.0.0 and below": ("float16", "float32", "float64")}, "mindspore")
  +@to_ivy_arrays_and_back
  +def adaptive_avg_pool2d(input, output_size):
  +    return ivy.adaptive_avg_pool2d(input, output_size)
  
verification_info: {"golden_diff": "diff --git a/ivy/functional/frontends/mindspore/ops/function/nn_func.py b/ivy/functional/frontends/mindspore/ops/function/nn_func.py\n--- a/ivy/functional/frontends/mindspore/ops/function/nn_func.py\n+++ b/ivy/functional/frontends/mindspore/ops/function/nn_func.py\n@@ -40,4 +40,10 @@\n @with_supported_dtypes({\"2.0 and below\": (\"int8\", \"int16\", \"int32\", \"int64\", \"float16\", \"float32\", \"float64\")}, \"mindspore\")\n @to_ivy_arrays_and_back\n def pad(input, pad_width, mode='constant', constant_values=0):\n-    return ivy.pad(input, pad_width, mode=mode, constant_values=constant_values)\n\\ No newline at end of file\n+    return ivy.pad(input, pad_width, mode=mode, constant_values=constant_values)\n+\n+\n+@with_supported_dtypes({\"2.0.0 and below\": (\"float16\", \"float32\", \"float64\")}, \"mindspore\")\n+@to_ivy_arrays_and_back\n+def adaptive_avg_pool2d(input, output_size):\n+    return ivy.adaptive_avg_pool2d(input, output_size)\n", "issue": "adaptive_avg_pool2d\nClose #20804\n", "before_files": [{"content": "\"\"\"Includes Mindspore Frontend functions listed in the TODO list\nhttps://github.com/unifyai/ivy/issues/14951.\"\"\"\n\n# 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@with_supported_dtypes(\n    {\n        \"2.0.0 and below\": (\n            \"int8\",\n            \"int16\",\n            \"int32\",\n            \"int64\",\n            \"float16\",\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"mindspore\",\n)\n@to_ivy_arrays_and_back\ndef dropout2d(input, p=0.5, training=True):\n    return ivy.dropout2d(input, p, training=training, data_format=\"NCHW\")\n\n\n@with_supported_dtypes({\"2.0.0 and below\": (\"float16\", \"float32\")}, \"mindspore\")\n@to_ivy_arrays_and_back\ndef selu(input_x):\n    return ivy.selu(input_x)\n\n\n@with_supported_dtypes({\"2.0 and below\": (\"float16\", \"float32\")}, \"mindspore\")\n@to_ivy_arrays_and_back\ndef softsign(x):\n    return ivy.divide(x, ivy.add(1, ivy.abs(x)))\n\n@with_supported_dtypes({\"2.0 and below\": (\"int8\", \"int16\", \"int32\", \"int64\", \"float16\", \"float32\", \"float64\")}, \"mindspore\")\n@to_ivy_arrays_and_back\ndef pad(input, pad_width, mode='constant', constant_values=0):\n    return ivy.pad(input, pad_width, mode=mode, constant_values=constant_values)", "path": "ivy/functional/frontends/mindspore/ops/function/nn_func.py"}]}