prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
   matrix_power
  
  
  --- 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/linalg.py`
  Content:
  ```
  1 # global
  2 import ivy
  3 from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  4 from ivy.functional.frontends.paddle import promote_types_of_paddle_inputs
  5 from ivy.functional.frontends.paddle.func_wrapper import (
  6     to_ivy_arrays_and_back,
  7 )
  8 
  9 
  10 @with_supported_dtypes(
  11     {"2.4.2 and below": ("float32", "float64", "int32", "int64")}, "paddle"
  12 )
  13 @to_ivy_arrays_and_back
  14 def cross(x, y, /, *, axis=9, name=None):
  15     x, y = promote_types_of_paddle_inputs(x, y)
  16     return ivy.cross(x, y, axis=axis)
  17 
  18 
  19 # matmul
  20 @with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
  21 @to_ivy_arrays_and_back
  22 def matmul(x, y, transpose_x=False, transpose_y=False, name=None):
  23     x, y = promote_types_of_paddle_inputs(x, y)
  24     return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)
  25 
  26 
  27 # norm
  28 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
  29 @to_ivy_arrays_and_back
  30 def norm(x, p="fro", axis=None, keepdim=False, name=None):
  31     if axis is None and p is not None:
  32         if p == "fro":
  33             p = 2
  34         ret = ivy.vector_norm(x.flatten(), ord=p, axis=-1)
  35         if keepdim:
  36             ret = ret.reshape([1] * len(x.shape))
  37         if len(ret.shape) == 0:
  38             return ivy.array([ret])
  39         return ret
  40 
  41     if isinstance(axis, tuple):
  42         axis = list(axis)
  43     if isinstance(axis, list) and len(axis) == 1:
  44         axis = axis[0]
  45 
  46     if isinstance(axis, int):
  47         if p == "fro":
  48             p = 2
  49         if p in [0, 1, 2, ivy.inf, -ivy.inf]:
  50             ret = ivy.vector_norm(x, ord=p, axis=axis, keepdims=keepdim)
  51         elif isinstance(p, (int, float)):
  52             ret = ivy.pow(
  53                 ivy.sum(ivy.pow(ivy.abs(x), p), axis=axis, keepdims=keepdim),
  54                 float(1.0 / p),
  55             )
  56 
  57     elif isinstance(axis, list) and len(axis) == 2:
  58         if p == 0:
  59             raise ValueError
  60         elif p == 1:
  61             ret = ivy.sum(ivy.abs(x), axis=axis, keepdims=keepdim)
  62         elif p == 2 or p == "fro":
  63             ret = ivy.matrix_norm(x, ord="fro", axis=axis, keepdims=keepdim)
  64         elif p == ivy.inf:
  65             ret = ivy.max(ivy.abs(x), axis=axis, keepdims=keepdim)
  66         elif p == -ivy.inf:
  67             ret = ivy.min(ivy.abs(x), axis=axis, keepdims=keepdim)
  68         elif isinstance(p, (int, float)) and p > 0:
  69             ret = ivy.pow(
  70                 ivy.sum(ivy.pow(ivy.abs(x), p), axis=axis, keepdims=keepdim),
  71                 float(1.0 / p),
  72             )
  73         else:
  74             raise ValueError
  75 
  76     else:
  77         raise ValueError
  78 
  79     if len(ret.shape) == 0:
  80         ret = ivy.array(
  81             [ret]
  82         )  # this is done so as to match shape of output from paddle
  83     return ret
  84 
  85 
  86 # eig
  87 @to_ivy_arrays_and_back
  88 def eig(x, name=None):
  89     return ivy.eig(x)
  90 
  91 
  92 # eigvals
  93 @to_ivy_arrays_and_back
  94 def eigvals(x, name=None):
  95     return ivy.eigvals(x)
  96 
  97 
  98 # eigvalsh
  99 @to_ivy_arrays_and_back
  100 def eigvalsh(x, UPLO="L", name=None):
  101     return ivy.eigvalsh(x, UPLO=UPLO)
  102 
  103 
  104 # eigh
  105 @to_ivy_arrays_and_back
  106 def eigh(x, UPLO="L", name=None):
  107     return ivy.eigh(x, UPLO=UPLO)
  108 
  109 
  110 # pinv
  111 @with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
  112 @to_ivy_arrays_and_back
  113 def pinv(x, rcond=1e-15, hermitian=False, name=None):
  114     # TODO: Add hermitian functionality
  115     return ivy.pinv(x, rtol=rcond)
  116 
  117 
  118 # solve
  119 @with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
  120 @to_ivy_arrays_and_back
  121 def solve(x1, x2, name=None):
  122     return ivy.solve(x1, x2)
  123 
  124 
  125 # cholesky
  126 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
  127 @to_ivy_arrays_and_back
  128 def cholesky(x, /, *, upper=False, name=None):
  129     return ivy.cholesky(x, upper=upper)
  130 
  131 
  132 # bmm
  133 @with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
  134 @to_ivy_arrays_and_back
  135 def bmm(x, y, transpose_x=False, transpose_y=False, name=None):
  136     if len(ivy.shape(x)) != 3 or len(ivy.shape(y)) != 3:
  137         raise RuntimeError("input must be 3D matrices")
  138     x, y = promote_types_of_paddle_inputs(x, y)
  139     return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)
  140 
  141 
  142 # matrix_power
  143 @with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
  144 @to_ivy_arrays_and_back
  145 def matrix_power(x, n, name=None):
  146     return ivy.matrix_power(x, n)
  147
  ```
  --- 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/linalg.py b/ivy/functional/frontends/paddle/tensor/linalg.py
  --- a/ivy/functional/frontends/paddle/tensor/linalg.py
  +++ b/ivy/functional/frontends/paddle/tensor/linalg.py
  @@ -130,3 +130,10 @@
           raise RuntimeError("input must be 3D matrices")
       x, y = promote_types_of_paddle_inputs(x, y)
       return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)
  +
  +
  +# matrix_power
  +@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
  +@to_ivy_arrays_and_back
  +def matrix_power(x, n, name=None):
  +    return ivy.matrix_power(x, n)
  
verification_info: {"golden_diff": "diff --git a/ivy/functional/frontends/paddle/tensor/linalg.py b/ivy/functional/frontends/paddle/tensor/linalg.py\n--- a/ivy/functional/frontends/paddle/tensor/linalg.py\n+++ b/ivy/functional/frontends/paddle/tensor/linalg.py\n@@ -130,3 +130,10 @@\n         raise RuntimeError(\"input must be 3D matrices\")\n     x, y = promote_types_of_paddle_inputs(x, y)\n     return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)\n+\n+\n+# matrix_power\n+@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n+@to_ivy_arrays_and_back\n+def matrix_power(x, n, name=None):\n+    return ivy.matrix_power(x, n)\n", "issue": " matrix_power\n\n", "before_files": [{"content": "# global\nimport ivy\nfrom ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes\nfrom ivy.functional.frontends.paddle import promote_types_of_paddle_inputs\nfrom ivy.functional.frontends.paddle.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\n\n\n@with_supported_dtypes(\n    {\"2.4.2 and below\": (\"float32\", \"float64\", \"int32\", \"int64\")}, \"paddle\"\n)\n@to_ivy_arrays_and_back\ndef cross(x, y, /, *, axis=9, name=None):\n    x, y = promote_types_of_paddle_inputs(x, y)\n    return ivy.cross(x, y, axis=axis)\n\n\n# matmul\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef matmul(x, y, transpose_x=False, transpose_y=False, name=None):\n    x, y = promote_types_of_paddle_inputs(x, y)\n    return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)\n\n\n# norm\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef norm(x, p=\"fro\", axis=None, keepdim=False, name=None):\n    if axis is None and p is not None:\n        if p == \"fro\":\n            p = 2\n        ret = ivy.vector_norm(x.flatten(), ord=p, axis=-1)\n        if keepdim:\n            ret = ret.reshape([1] * len(x.shape))\n        if len(ret.shape) == 0:\n            return ivy.array([ret])\n        return ret\n\n    if isinstance(axis, tuple):\n        axis = list(axis)\n    if isinstance(axis, list) and len(axis) == 1:\n        axis = axis[0]\n\n    if isinstance(axis, int):\n        if p == \"fro\":\n            p = 2\n        if p in [0, 1, 2, ivy.inf, -ivy.inf]:\n            ret = ivy.vector_norm(x, ord=p, axis=axis, keepdims=keepdim)\n        elif isinstance(p, (int, float)):\n            ret = ivy.pow(\n                ivy.sum(ivy.pow(ivy.abs(x), p), axis=axis, keepdims=keepdim),\n                float(1.0 / p),\n            )\n\n    elif isinstance(axis, list) and len(axis) == 2:\n        if p == 0:\n            raise ValueError\n        elif p == 1:\n            ret = ivy.sum(ivy.abs(x), axis=axis, keepdims=keepdim)\n        elif p == 2 or p == \"fro\":\n            ret = ivy.matrix_norm(x, ord=\"fro\", axis=axis, keepdims=keepdim)\n        elif p == ivy.inf:\n            ret = ivy.max(ivy.abs(x), axis=axis, keepdims=keepdim)\n        elif p == -ivy.inf:\n            ret = ivy.min(ivy.abs(x), axis=axis, keepdims=keepdim)\n        elif isinstance(p, (int, float)) and p > 0:\n            ret = ivy.pow(\n                ivy.sum(ivy.pow(ivy.abs(x), p), axis=axis, keepdims=keepdim),\n                float(1.0 / p),\n            )\n        else:\n            raise ValueError\n\n    else:\n        raise ValueError\n\n    if len(ret.shape) == 0:\n        ret = ivy.array(\n            [ret]\n        )  # this is done so as to match shape of output from paddle\n    return ret\n\n\n# eig\n@to_ivy_arrays_and_back\ndef eig(x, name=None):\n    return ivy.eig(x)\n\n\n# eigvals\n@to_ivy_arrays_and_back\ndef eigvals(x, name=None):\n    return ivy.eigvals(x)\n\n\n# eigvalsh\n@to_ivy_arrays_and_back\ndef eigvalsh(x, UPLO=\"L\", name=None):\n    return ivy.eigvalsh(x, UPLO=UPLO)\n\n\n# eigh\n@to_ivy_arrays_and_back\ndef eigh(x, UPLO=\"L\", name=None):\n    return ivy.eigh(x, UPLO=UPLO)\n\n\n# pinv\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef pinv(x, rcond=1e-15, hermitian=False, name=None):\n    # TODO: Add hermitian functionality\n    return ivy.pinv(x, rtol=rcond)\n\n\n# solve\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef solve(x1, x2, name=None):\n    return ivy.solve(x1, x2)\n\n\n# cholesky\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef cholesky(x, /, *, upper=False, name=None):\n    return ivy.cholesky(x, upper=upper)\n\n\n# bmm\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef bmm(x, y, transpose_x=False, transpose_y=False, name=None):\n    if len(ivy.shape(x)) != 3 or len(ivy.shape(y)) != 3:\n        raise RuntimeError(\"input must be 3D matrices\")\n    x, y = promote_types_of_paddle_inputs(x, y)\n    return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)\n\n\n# matrix_power\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef matrix_power(x, n, name=None):\n    return ivy.matrix_power(x, n)\n", "path": "ivy/functional/frontends/paddle/tensor/linalg.py"}], "after_files": [{"content": "# global\nimport ivy\nfrom ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes\nfrom ivy.functional.frontends.paddle import promote_types_of_paddle_inputs\nfrom ivy.functional.frontends.paddle.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\n\n\n@with_supported_dtypes(\n    {\"2.4.2 and below\": (\"float32\", \"float64\", \"int32\", \"int64\")}, \"paddle\"\n)\n@to_ivy_arrays_and_back\ndef cross(x, y, /, *, axis=9, name=None):\n    x, y = promote_types_of_paddle_inputs(x, y)\n    return ivy.cross(x, y, axis=axis)\n\n\n# matmul\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef matmul(x, y, transpose_x=False, transpose_y=False, name=None):\n    x, y = promote_types_of_paddle_inputs(x, y)\n    return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)\n\n\n# norm\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef norm(x, p=\"fro\", axis=None, keepdim=False, name=None):\n    if axis is None and p is not None:\n        if p == \"fro\":\n            p = 2\n        ret = ivy.vector_norm(x.flatten(), ord=p, axis=-1)\n        if keepdim:\n            ret = ret.reshape([1] * len(x.shape))\n        if len(ret.shape) == 0:\n            return ivy.array([ret])\n        return ret\n\n    if isinstance(axis, tuple):\n        axis = list(axis)\n    if isinstance(axis, list) and len(axis) == 1:\n        axis = axis[0]\n\n    if isinstance(axis, int):\n        if p == \"fro\":\n            p = 2\n        if p in [0, 1, 2, ivy.inf, -ivy.inf]:\n            ret = ivy.vector_norm(x, ord=p, axis=axis, keepdims=keepdim)\n        elif isinstance(p, (int, float)):\n            ret = ivy.pow(\n                ivy.sum(ivy.pow(ivy.abs(x), p), axis=axis, keepdims=keepdim),\n                float(1.0 / p),\n            )\n\n    elif isinstance(axis, list) and len(axis) == 2:\n        if p == 0:\n            raise ValueError\n        elif p == 1:\n            ret = ivy.sum(ivy.abs(x), axis=axis, keepdims=keepdim)\n        elif p == 2 or p == \"fro\":\n            ret = ivy.matrix_norm(x, ord=\"fro\", axis=axis, keepdims=keepdim)\n        elif p == ivy.inf:\n            ret = ivy.max(ivy.abs(x), axis=axis, keepdims=keepdim)\n        elif p == -ivy.inf:\n            ret = ivy.min(ivy.abs(x), axis=axis, keepdims=keepdim)\n        elif isinstance(p, (int, float)) and p > 0:\n            ret = ivy.pow(\n                ivy.sum(ivy.pow(ivy.abs(x), p), axis=axis, keepdims=keepdim),\n                float(1.0 / p),\n            )\n        else:\n            raise ValueError\n\n    else:\n        raise ValueError\n\n    if len(ret.shape) == 0:\n        ret = ivy.array(\n            [ret]\n        )  # this is done so as to match shape of output from paddle\n    return ret\n\n\n# eig\n@to_ivy_arrays_and_back\ndef eig(x, name=None):\n    return ivy.eig(x)\n\n\n# eigvals\n@to_ivy_arrays_and_back\ndef eigvals(x, name=None):\n    return ivy.eigvals(x)\n\n\n# eigvalsh\n@to_ivy_arrays_and_back\ndef eigvalsh(x, UPLO=\"L\", name=None):\n    return ivy.eigvalsh(x, UPLO=UPLO)\n\n\n# eigh\n@to_ivy_arrays_and_back\ndef eigh(x, UPLO=\"L\", name=None):\n    return ivy.eigh(x, UPLO=UPLO)\n\n\n# pinv\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef pinv(x, rcond=1e-15, hermitian=False, name=None):\n    # TODO: Add hermitian functionality\n    return ivy.pinv(x, rtol=rcond)\n\n\n# cholesky\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef cholesky(x, /, *, upper=False, name=None):\n    return ivy.cholesky(x, upper=upper)\n\n\n# bmm\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef bmm(x, y, transpose_x=False, transpose_y=False, name=None):\n    if len(ivy.shape(x)) != 3 or len(ivy.shape(y)) != 3:\n        raise RuntimeError(\"input must be 3D matrices\")\n    x, y = promote_types_of_paddle_inputs(x, y)\n    return ivy.matmul(x, y, transpose_a=transpose_x, transpose_b=transpose_y)\n\n\n# matrix_power\n@with_unsupported_dtypes({\"2.4.2 and below\": (\"float16\", \"bfloat16\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef matrix_power(x, n, name=None):\n    return ivy.matrix_power(x, n)\n", "path": "ivy/functional/frontends/paddle/tensor/linalg.py"}]}