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

Export Array from jax without installation #59

Closed
alexj-lee opened this issue Feb 1, 2023 · 2 comments
Closed

Export Array from jax without installation #59

alexj-lee opened this issue Feb 1, 2023 · 2 comments

Comments

@alexj-lee
Copy link

Thanks so much for this super useful package--it has been really useful for me. I am wondering if you might consider decoupling the jax.Array import from the main jax library? I realize this would be a lot of work but to the degree that I'd like to use jaxtyping for projects that may not actually use jax code in general it might increase adoption.

@patrick-kidger
Copy link
Owner

So jaxtyping should already support being used in non-JAX projects. For example:

from torch import Tensor
from jaxtyping import Float

def f(x: Float[Tensor, "foo bar"]): ...

Moreover jaxtyping does not even list JAX as a dependency.

@alexj-lee
Copy link
Author

Agh, so sorry, I totally missed the interchangeability of Tensor and ndarray etc in the annotation. I was trying to import Array, which then gave a jax import error, under the mistaken impression that the sense in which the library is interoperable was that Array could be used to hint for both numpy, torch, etc.

Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants