Hallucinated shapes
Coding agents write layers instantly, then quietly mismatch a tensor dimension buried inside a nested block. You trace it by hand.
tensorViz is an extension for VS Code, Cursor and Antigravity that turns your PyTorch model into a live, shape-verified graph, right beside the file that defines it. Edit the graph, it patches your code. Save the file, the graph redraws from the tensors that actually flowed.
PyTorch shapes fail silently, deep in the code. tensorViz makes the whole model visible, so the mismatch is obvious at a glance instead of three hours into a run.
Coding agents write layers instantly, then quietly mismatch a tensor dimension buried inside a nested block. You trace it by hand.
A shape bug discovered mid-run burns GPU budget and kills momentum. The maths was wrong before the first epoch ever started.
Code is a wall of text. The architecture, the thing you're actually reasoning about, stays invisible until it breaks.
Every node carries the file:line that produced it. Click a node,
the cursor jumps there. Edit a parameter in the graph, it comes back as a minimal patch to
your .py, one edit you can undo.
class Net(nn.Module): def __init__(self): super().__init__() self.conv = nn.Conv2d(3, 64, 3) → 64×56×56 self.bn = nn.BatchNorm2d(64) → 64×56×56 self.fc = nn.Linear(8, 8) → 2×8 self.act = nn.ReLU() def forward(self, x): return self.act(self.fc(x))
Open a file, the graph appears beside it. Click a node, the code jumps. Edit the code, the graph follows. Here it is, driving itself.
A save re-runs your class in a subprocess and redraws the graph from what actually flowed through it. Observed shapes appear as inlay hints on the lines that declared the layers. Only observed ones: an inferred shape in the same font would be a lie.
Any installed torchvision, transformers, diffusers or
timm model, or a cloned repo, becomes a shape-annotated graph. It reads the
architecture from the code alone. Nothing is downloaded or run.
Shape inference plus a synthetic forward pass. Failing layers light up on the canvas with the actual torch traceback on the node.
Download a self-contained zip: model.py, sample_run.py,
README.md, requirements.txt. It just runs.
Bring your own key for chat-driven edits over the same verifiable graph. Off by default, and every change it makes stays shape-checked.
Five surfaces you work in every day. Drag, or let it drift.
Linear(128, 256) + ReLU before the output and re-verify the shapes.
def __init__(self): self.conv = nn.Conv2d(3,64,3) → 64×56×56 self.bn = nn.BatchNorm2d(64) → 64×56×56 self.fc = nn.Linear(8,10) → 2×10
Draw it. Verify the shapes. Export runnable PyTorch, all inside your editor.
The extension is the first piece of a larger idea: making model architecture something you can see, verify, and reason about everywhere you work. More is on the way.
More to come