-
Notifications
You must be signed in to change notification settings - Fork 48
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
[Documentation] Comparison with tensor_annotations
#38
Comments
Haha, thank you :D So actually, despite the name -- So clearly Given this, why the
For completeness, the main differences are that:
|
Sweet tensor Jesus. So what you're saying is everyone should use
Noticed that. Then I shuddered. That doesn't scale to an arbitrary number of competing tensor frameworks... unlike Apparently, I'm supposed to be using
Runtime. This is the way.
I... I like what I'm hearing. Your words are convincing. Your code, even more convincing. Clearly, at least one of us is in a right frame of mind.
Gah! This is the only contentious point I contest. It's the curmudgeon in me that's makings me say this, but... it might be useful to generalize the name at some point. I know. I know. Technically, you'd rather not commit to supporting every existing tensor framework. Yes. I wouldn't either. There's meaningful work to do – and that's not it. Pragmatically, you've already committed to supporting JAX, TensorFlow, NumPy, and PyTorch. So, basically every existing tensor framework. Nobody talks about those other guys.
|
Well, "always use jaxtyping" certainly sounds like an excellent life choice to me. :) To suppory this use case, I should probably make the JAX dependence optional. Which in practice should be pretty easy; just lazy-import it for Regarding the naming -- this is actually quite a careful choice. The intended scope of this project can be summarised in the following diagram:
as jaxtyping already also provides support for JAX-specific notions like PyTrees, and may in the future also feature JAX-specific notions of I actually intend to completely overhaul TorchTyping at some point, and make it a fork of the relevant parts of jaxtyping. See also #18. I don't think a multi-backend frankenpackage is a good fit for this problem. For example, |
Today I learned... that the more I know, the less I know. Because the typing landscape is moving so rapidly, this list summarizes the little that I think I know:
Does that fully capture best typing practices for tensors as of Halloween? If so, mash that pumpkin. @beartype will freely shower the above advice onto data scientists in our FAQ. 🎃
But I still want a multi-backend frankenpackage! Cue a new |
But otherwise, yup, you've pretty much got it! |
Gotchas. I badly assumed Thanks so much for the clarifications! I'll get this typed up when life throws me a bucket of free time. 😓 |
You graciously name-dropped @beartype in your
Of course, @beartype documentation is still an unreadable monolithic mess of reStructuredText (reST). Therefore, this means less than it should. But thanks so much for all the phenomenal work you do here, at TorchTyping, and probably elsewhere! Google got the best with @patrick-kidger. 👏 👏 |
Hurrah! Thank you - that's really cool to see. 😎 |
Closing this issue! Current state of affairs: jaxtyping 🤝 beartype |
GitHub just recommended @deepmind's JAX-friendly
tensor_annotations
typing API in my feed. I was fascinated to see something I'd never seen before: a tensor typing API covering not one but two tensor frameworks. Cue chilling Halloween face. 😱Truly, the golden era of One Typing API to Rule Them All is upon us.
Documentation: You Bedevil Us Yet Again
The lack of runtime type-checking renders
tensor_annotations
ignorable from the (...admittedly limited) perspective of @beartype. Still, it might be useful to publicly compare and contrast the differences between these two packages here atjaxtyping
.The high-level tl;dr might be:
jaxtyping
covers only JAX but supports both runtime and static type-checking.tensor_annotations
covers both JAX and TensorFlow but supports only static type-checking.Tensors: The Future Begins Tomorrow
This gently leads into an orthogonal – and much larger – topic that probably deserves its own issue, too. But we are lazy. So let's idly chat here instead.
JAX is a Google product. TensorFlow is a Google product. Both expose tensors to Python.
jaxtyping
currently only types JAX. Couldjaxtyping
theoretically be expanded to type TensorFlow as well? If so, victory.Thanks so much for all the runtime type-checking support, @patrick-kidger and friends. You do the AI's good work.
The text was updated successfully, but these errors were encountered: