You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is to say, you're proposing to write an entirely new runtime type checker? That is what would be required, in order to handle cases like tuple[Float[Array, "foo"], ...], in which the jaxtyping annotations are nested inside arbitrarily many other annotations. That seems like a lot of work when we already have both typeguard and beartype which are mostly-good-enough already.
I believe the Float as Annotated hack will always be required for static type checking compatibility.
Hey @patrick-kidger!
I got this idea through our discussion in agronholm/typeguard#353. Wanted to create an issue here since it's unrelated to typeguard.
What if jaxtyping had its own typeguard-style instrumentation?
We could write annotations like
Float[T, S] = Annotated[T, Shape(S), DType("Float")]
, and the instrumentation could consume them to validate.Pros
Annotated as Float
hackCons
The text was updated successfully, but these errors were encountered: