We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b68c848 commit 0cd5237Copy full SHA for 0cd5237
src/fast_array_utils/stats/_power.py
@@ -33,7 +33,7 @@ def power(x: _Arr, n: int, /, dtype: DTypeLike | None = None) -> _Arr:
33
def _power(x: Array, n: int, /, dtype: DTypeLike | None = None) -> Array:
34
if TYPE_CHECKING:
35
assert not isinstance(x, types.DaskArray | types.CSBase | types.CupyCSMatrix)
36
- return np.power(x, n, dtype=dtype)
+ return x**n if dtype is None else np.power(x, n, dtype=dtype) # type: ignore[operator]
37
38
39
@_power.register(types.CSBase | types.CupyCSMatrix)
0 commit comments