mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-09-10 12:14:04 +08:00
Should be more robust to jax/numpy/tensorflow version changes
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
beartype
|
||||
cloudpickle
|
||||
equinox
|
||||
IPython
|
||||
jaxlib
|
||||
pytest
|
||||
tensorflow
|
||||
typeguard<3
|
||||
IPython
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user