Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion glass/_array_api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def get_namespace(*arrays: NDArray[Any] | Array) -> ModuleType:
if they do not.
"""
namespace = arrays[0].__array_namespace__()
if not all(array.__array_namespace__() == namespace for array in arrays):
if any(
array.__array_namespace__() != namespace
for array in arrays
if array is not None
):
msg = "input arrays should belong to the same array library"
raise ValueError(msg)

Expand Down