mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-09-09 11:24:55 +08:00
Hash is now stable across python runtimes
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
|
||||
import ast
|
||||
import functools as ft
|
||||
import hashlib
|
||||
import sys
|
||||
from collections.abc import Sequence
|
||||
from importlib.abc import MetaPathFinder
|
||||
@@ -165,7 +166,9 @@ class _JaxtypingLoader(SourceFileLoader):
|
||||
def __init__(self, *args, typechecker, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self._typechecker = typechecker
|
||||
self._typechecker_hash = str(abs(hash(self._typechecker)))
|
||||
self._typechecker_hash = hashlib.md5(
|
||||
self._typechecker.encode("utf-8")
|
||||
).hexdigest()
|
||||
|
||||
def source_to_code(self, data, path, *, _optimize=-1):
|
||||
source = decode_source(data)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "jaxtyping"
|
||||
version = "0.2.20"
|
||||
version = "0.2.21"
|
||||
description = "Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees."
|
||||
readme = "README.md"
|
||||
requires-python ="~=3.9"
|
||||
|
||||
Reference in New Issue
Block a user