diff options
author | Matthew <quitesimplymatt@gmail.com> | 2022-01-07 11:53:09 +0000 |
---|---|---|
committer | Matthew <quitesimplymatt@gmail.com> | 2022-01-07 12:27:33 +0000 |
commit | e3406ed3ef83f7de0f3419361e85bd8634d0fd2b (patch) | |
tree | f3817044a033b0fcbc84273161af9aff26c8d5e5 /numpy/array_api/_elementwise_functions.py | |
parent | f4a3e07877eb258f69a7d65d8a3b7e8d96e1aacd (diff) | |
download | numpy-e3406ed3ef83f7de0f3419361e85bd8634d0fd2b.tar.gz |
BUG: Allow integer inputs for pow-related functions in `array_api`
Updates `xp.power()`, `x.__pow__()`, `x.__ipow()__` and `x.__rpow()__`
Diffstat (limited to 'numpy/array_api/_elementwise_functions.py')
-rw-r--r-- | numpy/array_api/_elementwise_functions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/array_api/_elementwise_functions.py b/numpy/array_api/_elementwise_functions.py index 4408fe833..c758a0944 100644 --- a/numpy/array_api/_elementwise_functions.py +++ b/numpy/array_api/_elementwise_functions.py @@ -591,8 +591,8 @@ def pow(x1: Array, x2: Array, /) -> Array: See its docstring for more information. """ - if x1.dtype not in _floating_dtypes or x2.dtype not in _floating_dtypes: - raise TypeError("Only floating-point dtypes are allowed in pow") + if x1.dtype not in _numeric_dtypes or x2.dtype not in _numeric_dtypes: + raise TypeError("Only numeric dtypes are allowed in pow") # Call result type here just to raise on disallowed type combinations _result_type(x1.dtype, x2.dtype) x1, x2 = Array._normalize_two_args(x1, x2) |