Compare commits

..
2 Commits
Author SHA1 Message Date
Patrick Kidger f175c7f315 Fixed py.type not being packaged (#30) 2022-09-22 12:16:25 -07:00
Patrick Kidger da8300ec6c tidyness tweak (#28) 2022-09-20 15:16:52 -07:00
4 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
include LICENSE
prune tests
include jaxtyping/py.typed
prune test
+1 -1
View File
@@ -63,4 +63,4 @@ from .import_hook import install_import_hook
from .pytree_type import PyTree
__version__ = "0.2.4"
__version__ = "0.2.5"
+9 -10
View File
@@ -150,26 +150,25 @@ class _MetaAbstractArray(type):
if cls.dtypes is not _any_dtype and dtype not in cls.dtypes:
return False
temp_memo = not hasattr(storage, "memo_stack") or len(storage.memo_stack) == 0
no_temp_memo = hasattr(storage, "memo_stack") and len(storage.memo_stack) != 0
if temp_memo:
if no_temp_memo:
single_memo, variadic_memo, variadic_broadcast_memo = storage.memo_stack[-1]
# Make a copy so we don't mutate the original memo during the shape check.
single_memo = single_memo.copy()
variadic_memo = variadic_memo.copy()
variadic_broadcast_memo = variadic_broadcast_memo.copy()
else:
# `isinstance` happening outside any @jaxtyped decorators, e.g. at the
# global scope. In this case just create a temporary memo, since we're not
# going to be comparing against any stored values anyway.
single_memo = {}
variadic_memo = {}
variadic_broadcast_memo = {}
else:
single_memo, variadic_memo, variadic_broadcast_memo = storage.memo_stack[-1]
# Make a copy so we don't mutate the original memo during the shape check.
single_memo = single_memo.copy()
variadic_memo = variadic_memo.copy()
variadic_broadcast_memo = variadic_broadcast_memo.copy()
temp_memo = False
if cls._check_shape(obj, single_memo, variadic_memo, variadic_broadcast_memo):
# We update the memo every time we successfully pass a shape check
if not temp_memo:
if no_temp_memo:
storage.memo_stack[-1] = (
single_memo,
variadic_memo,
+1
View File
@@ -94,4 +94,5 @@ setuptools.setup(
install_requires=install_requires,
entry_points=entry_points,
packages=[name],
include_package_data=True,
)