Your model,
drawn.

tensorViz is a PyTorch model visualizer: open an nn.Module from Python source as an interactive graph with measured tensor shapes, without torch.export or ONNX conversion.

VS Code · Cursor · VSCodium

code --install-extension tensorviz.tensorviz-vscode Quickstart ↗

Explore the model canvas

Open full view ↗

Humans and agents

Give your agent
the model.

Let your coding agent work on the model with you. It proposes a change; you review the graph and Python diff, then accept or discard it.

From inspect_nodes to propose_edit, through the VS Code extension. You stay in control of the edit.

Add the coding-agent plugin

Claude Code · Codex · Cursor

Your agent, with the graphIllustrated workflow
Input (1, 64) Linear stem ResidualBlock 4 layers Linear 10 outputs Output result DRAFT 20 outputs

“Edit the classifier head to output 20 classes.”

  1. get_graph5 top-level nodes
  2. inspect_nodeshead · Linear · 128 → 10
  3. propose_editout_features: 10 → 20
residual-after.py :26 Draft from agent
self.head = nn.Linear(128, 10) self.head = nn.Linear(128, 20)
Back to the canvas

Interactive illustration, not a live agent session. The agent reads the ResidualClassifier source graph and proposes changing the head from 10 to 20 output features. Accept and Discard change this illustration only; no model file is written or executed.

Compare two revisions,
layer by layer.

Graph review compares layers and connections between two Python revisions, with the code diff beside the graph.

MlpTiny is a separate example: a source comparison, not executed. Switch between its Before, Diff, After and Python source views. Click to explore; Esc releases it.

Graph review docs ↗
Opening the MlpTiny review…

Code focus

Select a layer.
Read its code.

Select a layer in the graph to find its Python. Focus on one expression, its function or the whole class, and dim the rest. Try it below.

FusionBlockInteractive graph
Try a layer

Opening the interactive example…

two-tower.pyPython
Select a layer to follow its source. Download Python

A working browser example with the native TensorViz graph and its original Python.

Download graph ↗

Find a shape mismatch.
See the one-line fix.

ResidualClassifier was run once per revision and the result kept. Revision A declares a head that accepts 64 features, but the residual block delivers 128. Revision B changes one number.

evidence-before.json ↗
evidence-after.json ↗

Recorded Sep 16, 2026 · CPU · PyTorch 2.7.1 · input 1 × 64 · one forward call per revision. These are saved records; nothing runs on this page.

ARRIVES AT THE HEAD

128

recorded input 1 × 128, from the residual block

≠

HEAD DECLARES in_features

64

residual-before.py, line 26

RECORDED HEAD OUTPUT

—

not produced: the call failed at line 31

26self.head = nn.Linear(64, 10)
31return self.head(x)raised here

RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x128 and 64x10)

Hugging Face

From model link
to model graph.

Bring a supported Hugging Face model into your editor. Capture a forward pass, expand its modules and follow the tensors through the actual architecture.

Open a Hugging Face model
HuggingFaceTB / SmolLM2-135M

Opening the SmolLM2 graph…

SmolLM2-135M · pinned checkpoint, original TensorViz canvas.Capture details

Open your own model.

Install the editor extension, or add the coding-agent plugin to your agent. Both open the same canvas on your project, with your Python.

EDITOR EXTENSION

In VS Code, Cursor or VSCodium

Click Open as Graph above your model class. Run one forward call with your inputs, or choose Inspect source only to preview without running it.

TERMINAL
code --install-extension tensorviz.tensorviz-vscode

Install the extension, then open your Python project.

VS Code 1.106 or newer · model Python 3.10+ · TensorViz service Python 3.11+

CODING-AGENT PLUGIN · PREVIEW

In Claude Code, Codex or Cursor

Ask in a new chat to open your model. The plugin captures one forward call and shows the same canvas as the editor extension.

Cursor ↗
Add to Claude Code

Opens Claude Code with a setup prompt to review and send.

Or run in a terminal
claude plugin marketplace add tensorviz-org/tensorviz
claude plugin install tensorviz@tensorviz-standalone --scope user
Then, in a new chat

“Open my model as a TensorViz graph.”

Preview: macOS and glibc Linux (x64/ARM64); Windows (x64/ARM64) in Codex. CPython 3.12 · CPU capture. The first connection downloads a verified runtime, so it needs internet access. Platform requirements ↗

NOTE

Use one TensorViz host per agent. Don't connect the same agent to both the plugin and the extension.

Full installation guide ↗

No install needed to look around: browse published graphs in the Model Explorer →

Notes

  1. How do I visualize a PyTorch model?

    Install the editor extension or coding-agent plugin, then click Open as Graph above your nn.Module class or ask the agent to open it. Inspect source only previews the graph without running the model. Follow the quickstart or the architecture visualization guide.

  2. Do I need torch.export, TorchScript or ONNX?

    No. Capture runs one ordinary eager forward call in your Python environment and records shapes with forward module hooks and a TorchDispatchMode. Inspect source only reads the code without running the model.

  3. How is tensorViz different from Netron?

    Netron opens saved model files such as ONNX, TorchScript and safetensors. tensorViz opens the Python source in your project, links each layer to its code, and compares revisions. Netron is a great choice for exported files. See the full comparison.

  4. How is tensorViz different from torchview / torchviz / torchinfo?

    torchview and torchviz produce static Graphviz diagrams from Python; torchinfo produces a text summary. tensorViz provides an interactive, expandable canvas in your editor or coding agent with source navigation and Graph review. See the full comparison.

  5. How is tensorViz different from Google's Model Explorer?

    Google's Model Explorer is strong for very large graphs and converted formats; its PyTorch path goes through torch.export. tensorViz captures an eager forward call without an export step. See the full comparison.

  6. Is tensorViz free or open source, and does it need an AI key?

    tensorViz is free to install. Core graph tools do not require an AI subscription or provider key. The source repository is public on GitHub under the MIT license.

  7. Is tensorViz the tensorviz package on PyPI?

    No. tensorViz (tensorviz.dev) installs as an editor extension or coding-agent plugin. The PyPI package named tensorviz is an unrelated project, so pip install tensorviz does not install tensorViz.

  8. Where does my model run?

    On your machine, in the Python environment you choose. With desktop VS Code Remote SSH, install TensorViz on the host; files and execution stay there.

  9. Why do some cards say Not recorded?

    Shapes come from a captured run. Source-only graphs have none to show.

  10. What's in a .tensorviz.json file?

    The graph, available capture details, layout, saved views and notes. Model source and weights aren't included; check labels and notes before sharing.

  11. Can I view a graph without installing anything?

    Yes. Shared graphs and published models open in the browser in the Model Explorer.

Start with your model

See the model. Change the model. Bring your agent.

Or explore a model in your browser