Calling this raises the following error:
AnnotationError: Do not use isinstance(x, jaxtyping.Float). If you want to check just the dtype of an array, then use jaxtyping.Float[jnp.ndarray, "..."].
The error is from:
File ~/anaconda3/envs/arm/lib/python3.10/site-packages/jaxtyping/_array_types.py:561, in _MetaAbstractDtype.instancecheck(cls, obj)
560 def __instancecheck__(cls, obj: Any) -> NoReturn:
--> 561 raise AnnotationError(
562 f"Do not use `isinstance(x, jaxtyping.{cls.__name__})`. If you want to "
563 "check just the dtype of an array, then use "
564 f'`jaxtyping.{cls.__name__}[jnp.ndarray, "..."]`.'
565 )
I am building a code using
cupy
, andjaxtyping
for type-hinting to calculate the Laplacian of Gaussian of a function. Here is my code:Calling this raises the following error: AnnotationError: Do not use
isinstance(x, jaxtyping.Float)
. If you want to check just the dtype of an array, then usejaxtyping.Float[jnp.ndarray, "..."]
.The error is from:
File ~/anaconda3/envs/arm/lib/python3.10/site-packages/jaxtyping/_array_types.py:561, in _MetaAbstractDtype.instancecheck(cls, obj)