Tensor-Puzzles icon indicating copy to clipboard operation
Tensor-Puzzles copied to clipboard

Upgrade Tensor Puzzlers from torchtyping to jaxtyping.

Open davideger opened this issue 1 year ago • 3 comments

jaxtyping is a new, improved, and maintained version of torchtyping by the same author (patrick kidger). When used with beartype, jaxtyping can inform the user of shape mismatch errors at run time.

Other minor formatting issues were fixed in the Tensor Puzzles notebook.

davideger avatar Jan 12 '24 00:01 davideger

Amazing! I was just planning on doing this.

srush avatar Jan 12 '24 00:01 srush

Just curious, Why do you need "{j j}"?

srush avatar Jan 12 '24 16:01 srush

My understanding (and @patrick-kidger correct me if I am wrong) is that if you want jaxtyping to ensure that a return type dimension matches a scalar function parameter, you need to use f-string escaping to reference the function parameter. At least that's what I get from interpreting https://github.com/google/jaxtyping/blob/main/docs/api/array.md.

davideger avatar Jan 12 '24 19:01 davideger