Skip to content

Commit 0cd5237

Browse files
committed
even faster
1 parent b68c848 commit 0cd5237

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fast_array_utils/stats/_power.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def power(x: _Arr, n: int, /, dtype: DTypeLike | None = None) -> _Arr:
3333
def _power(x: Array, n: int, /, dtype: DTypeLike | None = None) -> Array:
3434
if TYPE_CHECKING:
3535
assert not isinstance(x, types.DaskArray | types.CSBase | types.CupyCSMatrix)
36-
return np.power(x, n, dtype=dtype)
36+
return x**n if dtype is None else np.power(x, n, dtype=dtype) # type: ignore[operator]
3737

3838

3939
@_power.register(types.CSBase | types.CupyCSMatrix)

0 commit comments

Comments
 (0)