r/pytorch • • 6d ago

We turned PyTorch forward passes into interactive graphs that you and coding agents can inspect

Hi r/pytorch. Disclosure up front: I'm one of the makers of tensorViz. It's free and MIT licensed.

What it does: you point it at an nn.Module in your project and give it example inputs once. It runs one ordinary eager forward call, records what every module actually received and returned (forward module hooks plus a TorchDispatchMode), and shows an expandable graph with every module and measured tensor shape. No torch.export, TorchScript or ONNX step. If you'd rather not run anything, "Inspect source only" previews the graph from the code.

Why we built it: coding agents read the source but never see the shapes, so a change to one layer becomes a shape mismatch three modules later. With the plugin, Claude Code, Codex or Cursor can search the graph for a layer, op or parameter and read the measured shapes before editing. Through the VS Code extension, the agent proposes an edit and you review the graph and the Python diff before accepting it.

Also in there:

- Select a layer to jump to its Python

- Compare two revisions layer by layer, with the code diff beside the graph

- Open supported Hugging Face models

Limits (it's a preview):

- CPU capture only; GPU and training runs aren't covered yet

- Very large models can produce a partial graph

Site: https://tensorviz.dev

Code: https://github.com/tensorviz-org/tensorviz

Model Explorer → https://tensorviz.dev/explore

I'd really like to hear where it breaks on your models: custom ops, unusual control flow, very large models. That's the feedback we need most.

15 Upvotes

1 comment sorted by

1

u/kanuz 1d ago

Looks quite interesting! Can't wait to give it a try... Something happened to the repo, tho!