Skip to content

Commit 6455f69

Browse files
committed
np.minimum -> xp.minimum
1 parent c8f6613 commit 6455f69

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

array_api_compat/common/_helpers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,15 +1048,15 @@ def power(self, y, /, **kwargs):
10481048

10491049
def min(self, y, /, **kwargs):
10501050
"""x[idx] = minimum(x[idx], y)"""
1051-
import numpy as np
1052-
1053-
return self._iop("min", np.minimum, y, **kwargs)
1051+
xp = array_namespace(self.x)
1052+
y = xp.asarray(y)
1053+
return self._iop("min", xp.minimum, y, **kwargs)
10541054

10551055
def max(self, y, /, **kwargs):
10561056
"""x[idx] = maximum(x[idx], y)"""
1057-
import numpy as np
1058-
1059-
return self._iop("max", np.maximum, y, **kwargs)
1057+
xp = array_namespace(self.x)
1058+
y = xp.asarray(y)
1059+
return self._iop("max", xp.maximum, y, **kwargs)
10601060

10611061

10621062
__all__ = [

0 commit comments

Comments
 (0)