logoalt Hacker News

ainchyesterday at 5:21 PM2 repliesview on HN

The Pyrefly type checker is starting to work on this kind of shape hinting - so far it only works on Torch but I believe the plan is for it to work with other array packages (eg. JAX, NumPy)

https://pyrefly.org/en/docs/tensor-shapes/#how-it-works


Replies

nestorDtoday at 2:49 AM

See also jaxtyping which, contrary to what its name might imply, covers JAX/PyTorch/NumPy/MLX/TensorFlow arrays and tensors.

https://docs.kidger.site/jaxtyping/

show 1 reply
mathisfun123yesterday at 6:17 PM

Shape functions and shape analysis are basically mundane infra in almost every ML compiler/language/DSL.

https://mlir.llvm.org/docs/Dialects/ShapeDialect/

show 1 reply