More/Better typing? #555
junpenglao
started this conversation in
New features
Replies: 1 comment
-
I like runtime type-checking, it's useful for efficiently writing bug-free code and a great complement to testing. It seems like we'd need to change various |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;dr: Should we introduce jaxtyping and beartype?
Currently Problem
As noted in #543 (comment), I am not happy about the way
logdensity
is annotated (e.g., see example). While they are Array (as they are in most cases should be output of a Jax function), we annotate them as float to empathizes they should be scalar.Potential Solution
While jaxtyping is introduced to solve this, it would make the code much longer
We also have a lot of function that accepts nested structure (PyTree), although we can introduce beartype so runtime check speed would not be a concern.
Beta Was this translation helpful? Give feedback.
All reactions