Skip to content

Commit 3c2f31d

Browse files
committed
multiple namespaces
1 parent 5fc5379 commit 3c2f31d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

array_api_compat/common/_helpers.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -938,13 +938,13 @@ def power(self, y, /, **kwargs):
938938

939939
def min(self, y, /, **kwargs):
940940
self._check_args(**kwargs)
941-
xp = array_namespace(self.x)
941+
xp = array_namespace(self.x, y)
942942
self.x[self.idx] = xp.minimum(self.x[self.idx], y)
943943
return self.x
944944

945945
def max(self, y, /, **kwargs):
946946
self._check_args(**kwargs)
947-
xp = array_namespace(self.x)
947+
xp = array_namespace(self.x, y)
948948
self.x[self.idx] = xp.maximum(self.x[self.idx], y)
949949
return self.x
950950

@@ -963,14 +963,14 @@ def iwhere(condition, x, y, /):
963963
"""
964964
if is_writeable_array(x):
965965
if is_array_api_obj(y) and len(y.shape) > 0:
966-
xp = array_namespace(x)
966+
xp = array_namespace(x, y)
967967
x, y = xp.broadcast_arrays(x, y)
968968
x[condition] = y[condition]
969969
else:
970970
x[condition] = y
971971
return x
972972
else:
973-
xp = array_namespace(x)
973+
xp = array_namespace(x, y)
974974
return xp.where(condition, x, y)
975975

976976
__all__ = [

0 commit comments

Comments
 (0)