We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3b8c17 commit 09463d0Copy full SHA for 09463d0
equinox/_filters.py
@@ -28,10 +28,10 @@
28
29
30
# Define array types
31
-# Note that we don't accept `np.generic` as a suitable duck-type for arrays,
32
-# because `generic` includes `np.object_` and `np.flexible` which are not
33
-# array-like.
34
-NDArrayType: TypeAlias = np.ndarray | np.number | np.bool_
+# Note that `np.generic` covers more than just the array-like dtypes,
+# e.g. `np.object_` and `np.flexible`. But `ml_dtypes` also defines dtypes
+# that inherit from `np.generic` and can't easily be listed here individually.
+NDArrayType: TypeAlias = np.ndarray | np.generic
35
_NDARRAY_TYPES: Final = get_args(NDArrayType)
36
_ARRAY_TYPES = _NDARRAY_TYPES + (jax.Array,)
37
0 commit comments