Stop Annoying Shape Bugs in PyTorch, JAX and NumPy With This One Tool @FacebookOpenSource
Stop Annoying Shape Bugs in PyTorch, JAX and NumPy With This One Tool  @FacebookOpenSource
Uploaded October 2026 | Updated November 2026, 3 days ago
Shape bugs are some of the most painful bugs in ML code, and traditional type systems can't catch them, because all they tell you is that you have "a tensor."

In this video, Meta engineers Avik Chaudhuri and Steven Troxler introduce static tensor shape checking in Pyrefly: a production-grade static type system that tracks tensor shapes. Starting from just a few annotations at module boundaries, Pyrefly infers the shape of every intermediate value, shows it as an inlay hint in your editor, and flags mismatches before you ever run your code, across PyTorch, JAX, and NumPy code.

TRY IT
• Pyrefly: pyrefly.org
• GitHub: github.com/facebook/pyrefly
• Docs: getting started with Pyrefly tensor shapes: pyrefly.org/en/docs/tensor-shapes
• Discord: #shape-types channel: discord.com/channels/1319086885024567347/1519422996970737885

CHAPTERS
00:00 Intro: static tensor shapes come to Pyrefly
03:16 Demo: a PyTorch cross-attention module with two hidden bugs
06:09 Demo: how Pyrefly uses symbolic arithmetic
07:40 Demo: NumPy array shapes
12:33 Demo: JAX Gaussians and self-attention
13:50: Demo: PyTorch MLP with nn.Sequential
14:51 Demo: PyTorch tracking shapes through a convnet
15:38 Demo: Annotating real-world model codebases using Pyrefly tensor shapes
18:50 Demo: auto-annotating Whisper with the Pyrefly agent skill
21:36 What's next?
23:11 How to try Pyrefly tensor shape checking today
Stop Annoying Shape Bugs in PyTorch, JAX and NumPy With This One ToolELI5: IGListKitEffortless JSON in C++ with folly::dynamicELI5: Starlark-RustFrom Egocentric to Embodied World Models with Jakob Engel at ECCV 2026ELI5: BelowAnnouncing Pyrefly BetaELI5: ComponentKit for UI Code Generation on iOSIntroducing the Project Aria Research KitELI5: DucklingProject Aria CVPR 2022 Tutorial: Multi-Sensor Localization for Indoor Navigation from CMU (10 of 11)The Diff Episode 17: How the team realized Presto could be faster
Meta Open Source |

Stop Annoying Shape Bugs in PyTorch, JAX and NumPy With This One Tool

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER