Compare commits

..
2 Commits
3 changed files with 6 additions and 2 deletions
+4
View File
@@ -145,6 +145,7 @@ else:
pass
Array.__module__ = "builtins"
Array.__qualname__ = "Array"
return Array
else:
import jax
@@ -157,6 +158,7 @@ else:
pass
ArrayLike.__module__ = "builtins"
ArrayLike.__qualname__ = "ArrayLike"
return ArrayLike
else:
import jax.typing
@@ -169,6 +171,7 @@ else:
pass
PRNGKeyArray.__module__ = "builtins"
PRNGKeyArray.__qualname__ = "PRNGKeyArray"
return PRNGKeyArray
else:
# New-style `jax.random.key` have scalar shape and dtype `key<foo>`.
@@ -216,6 +219,7 @@ else:
if typing.GENERATING_DOCUMENTATION:
# Equinox etc. docs get just `PyTreeDef`.
# jaxtyping docs get `jaxtyping.PyTreeDef`.
PyTreeDef.__qualname__ = "PyTreeDef"
PyTreeDef.__module__ = "builtins"
return PyTreeDef
else:
+1 -1
View File
@@ -229,7 +229,7 @@ class _MetaAbstractArray(type):
return _check_dims(cls.dims, obj.shape, single_memo, arg_memo)
else:
if obj.ndim < len(cls.dims) - 1:
return f"this array has {obj.ndim} dimensions, which is fewer than {len(cls.dims - 1)} that is the minimum expected by the type hint" # noqa: E501
return f"this array has {obj.ndim} dimensions, which is fewer than {len(cls.dims) - 1} that is the minimum expected by the type hint" # noqa: E501
i = cls.index_variadic
j = -(len(cls.dims) - i - 1)
if j == 0:
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "jaxtyping"
version = "0.2.26"
version = "0.2.27"
description = "Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees."
readme = "README.md"
requires-python ="~=3.9"