Should be more robust to jax/numpy/tensorflow version changes

This commit is contained in:
Patrick Kidger
2023-09-25 11:07:36 -07:00
parent e05985df2b
commit 1e5229c20e
4 changed files with 29 additions and 5 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
beartype
cloudpickle
equinox
IPython
jaxlib
pytest
tensorflow
typeguard<3
IPython
+13
View File
@@ -0,0 +1,13 @@
# Tensorflow dependency kept in a separate file, so that we can optionally exclude it
# more easily.
import tensorflow as tf
from jaxtyping import UInt
def test_tf_dtype():
x = tf.constant(1, dtype=tf.uint8)
y = tf.constant(1, dtype=tf.float32)
hint = UInt[tf.Tensor, "..."]
assert isinstance(x, hint)
assert not isinstance(y, hint)