Skip to content

Commit 65e630a

Browse files
committed
fix
1 parent 9952ed1 commit 65e630a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

array_api_strict/_array_object.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,9 @@ def __getitem__(
729729
np_key = key
730730
devices = {self.device}
731731
if isinstance(key, tuple):
732-
devices.update([subkey.device for subkey in key])
732+
devices.update(
733+
[subkey.device for subkey in key if hasattr(subkey, "device")]
734+
)
733735
if len(devices) > 1:
734736
raise ValueError(
735737
"Array indexing is only allowed when array to be indexed and all "

0 commit comments

Comments
 (0)