Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I inspect the jaxtyping bindings? #158

Open
smathis-absci opened this issue Jan 8, 2024 · 2 comments
Open

How can I inspect the jaxtyping bindings? #158

smathis-absci opened this issue Jan 8, 2024 · 2 comments
Labels
feature New feature

Comments

@smathis-absci
Copy link

Hi and thank you for this fantastic work!

When debugging my code, which uses beartype and jaxtyping, I repeatedly encountered issues where I wanted to inspect the bindings of jaxtyping at a particular point of the code. However, I could not find an easy way in the documentation that exposes the bindings.

What would be the best way to inspect jaxtyping bindings at a point of the code, to use e.g. when stepping through with a debugger?

Thank you for your help!

@smathis-absci
Copy link
Author

Oh I think I found a way:

from jaxtyping._storage import get_shape_memo

...[your code]...
print(get_shape_memo()[:3])
...[your code]...

@patrick-kidger
Copy link
Owner

Haha, well sleuthed! I've just created #159 to offer this as a public API, and in a human-readable fashion.

I hope that helps!

@patrick-kidger patrick-kidger added the feature New feature label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants