Skip to content
| Marketplace
Sign in
Visual Studio Code>Machine Learning>tensorViz — PyTorch & JAX Model VisualizerNew to Visual Studio Code? Get it now.
tensorViz — PyTorch & JAX Model Visualizer

tensorViz — PyTorch & JAX Model Visualizer

tensorViz

|
82 installs
| (1) | Free
Explore PyTorch and JAX/Flax model graphs, inspect tensor shapes, jump to Python source, and review PyTorch architecture changes in VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

tensorViz — PyTorch & JAX Model Visualizer

Follow tensor shapes through your model, beside the Python you are editing.

tensorViz opens a PyTorch nn.Module as an interactive graph in VS Code. Expand nested modules, inspect shapes from a captured forward pass, and jump from a layer to its source. Plain JAX functions and Flax modules also open as traced programs with inferred shapes.

Captured example: shapes and source navigation

Recorded in 0.1.10; setup not shown. Shapes describe this example input.

  • Understand a model: explore one block at a time instead of reading the whole definition.
  • Investigate a shape mismatch: follow the shapes recorded for your example inputs.
  • Review architecture changes: compare a Python diff or pull request beside the graph.

PyTorch captured shapes describe one input and execution path. Graph diff compares source without executing either revision; unresolved coverage stays visible.

Free to install. Core graph exploration and source forms work without a coding agent.

Get started · Watch the walkthrough · Try the Model Explorer · Examples and issues

The linked repository contains public examples and support material; the extension's source repository remains private.

The browser examples are recorded snapshots and need no installation. Open your own model in VS Code to capture it in your selected Python environment.

Your first graph

  1. Install and choose a model. Install tensorViz in VS Code 1.106 or newer and open your model's folder. To start with an example, run tensorViz: New model from template and choose MLP classifier or Small CNN. Both starters are included in the extension.
  2. Open the graph and prepare Python. Click Open as Graph above the nn.Module class, or choose it in tensorViz's Models view. Reuse your compatible project Python or choose a Conda/venv when asked. tensorViz checks dependencies and asks before downloads or library changes; existing Torch/CUDA versions are preserved. Initial setup can take time.
  3. Capture and explore. tensorViz reuses saved setup or prepares example inputs. Fill in any missing constructor values or inputs beside the source-only preview. Completing setup saves tensorviz.toml and captures one forward call. Once shapes are measured, expand a block, select a layer and follow its source link. After editing the model, save and choose Refresh graph to capture again.

Capture needs Python 3.10–3.14 with compatible PyTorch and your model's dependencies. The separate tensorViz service needs Python 3.11+; it can use a managed environment after your approval. Inspect source only does not execute your model. No repository checkout, Node.js or coding agent is required.

Full setup and troubleshooting · Remote SSH · Python and platform compatibility

Use Show Canvas / Hide Canvas or Ctrl+Cmd+G on macOS (Ctrl+Alt+G on Windows/Linux) to toggle the sidebar without losing your selected model. Open Canvas in Browser opens it in a separate browser view. If setup fails, its inline controls let you retry; tensorViz: Select Python Environment changes the model environment and tensorViz: Repair runtime repairs only the separate tensorViz runtime. See the opening guide.

JAX and Flax

Install compatible jax and, for Flax models, flax in your selected Python. Choose Open as Graph above a JAX function or Flax Linen/NNX class and enter explicit example input shapes. For example:

import jax.numpy as jnp

def net(x):
    return jnp.tanh(x @ jnp.ones((3, 4)))

An input of shape 2, 3 produces a traced graph with output shape 2, 4. The saved tensorviz.toml profile has framework = "jax". Linen modules use the saved seed to initialize fresh parameters; use a Python setup factory to bind trained variables or construct NNX state.

JAX support currently traces on CPU and labels shapes as inferred. Control flow primitives retain their boundary and report partial coverage; tracing does not claim a branch executed. PyTorch source edits are unavailable for these graphs. The shared capture worker still requires Torch.

Explore and edit

Pan, zoom, search, expand nested modules and use the Overview minimap. Select a node and click its file:line link at inspection zoom to open its source. Moving the editor cursor into a mapped layer focuses it on the graph. Parse errors leave the last graph visibly stale until the source is fixed.

Turn on Code focus in the Canvas header to open each selected node's source beside the graph; double-click or Enter on a layer moves keyboard focus to it. The chevron beside it can dim unrelated code. With the Canvas maximized, showing source restores the split so the code appears beside it.

To use your existing coding agent, run tensorViz: Connect coding agent (MCP). A status-bar item shows Off, Ready or Connected. The connection panel can configure a supported agent after approval or provide the URL for a Streamable HTTP client. The agent's open_graph tool opens and captures a model, completes missing setup and requests dependency installation in TensorViz's reported capture environment. It also inspects graphs, focuses a view and proposes source edits. Each opens in VS Code's native diff: choose Apply source change or Discard proposal in its toolbar. Apply changes the unsaved buffer; native Undo restores it. Changed source or dependencies invalidate an old proposal. The MCP connection uses your existing coding agent. See MCP setup.

Edits stay within supported constructs in one owning class. Shared definitions affect every instance. Grouping changes parameter paths and checkpoint keys. Source review checks syntax and graph consistency, not runtime tensor correctness.

Share a graph file

Choose Export graph in the canvas to save a .tensorviz.json snapshot. Open graph file viewer opens the independent viewer for pan, zoom, search, module expansion, saved views, walkthroughs and layer/connection discussions. Choose an opening view for recipients, or compare two files to review architecture changes. Download the annotated file to share it. Recipients need a static viewer page and the file; they do not need Python or the extension. Open the public graph viewer to explore a snapshot.

Capture and settings

After changing source, save and choose Refresh graph to capture again. Change inputs edits the saved setup. Generated dimensions are example values, not recovered training settings; a successful capture covers that invocation only. Choose Model creation → Python function in model setup to reuse an existing model builder or return the selected component from a pipeline. Modules can remain in their original files. The factory must return the selected class. See input setup guide.

Capture on save is off by default. In a trusted workspace, tensorviz.traceOnSave reuses a matching saved profile in the selected interpreter. Missing or ambiguous setup refuses execution. Typing refreshes the source projection without running it.

Setting Use
tensorviz.pythonPath Interpreter hint; the workspace environment choice takes precedence
tensorviz.repoPath Developer checkout override; leave empty for packaged use
tensorviz.devServerUrl Developer frontend override; leave empty for packaged use

The selected project Python runs the model. A separate compatible tool environment runs the tensorViz service and dependency installer; changing model Python keeps that service running. The backend launch token stays in VS Code; the browser receives a limited session credential. The MCP endpoint has no bearer credential and relies on its loopback bind and Host/Origin checks.

Optional analytics

When analytics are available in your installed release, tensorViz asks before sharing feature usage, performance and categorized errors. Sharing is off by default and respects VS Code telemetry permissions. Code, model contents, paths, prompts and raw exceptions are excluded. A random local installation ID helps measure returning use; it is not an account or machine ID. Use TensorViz: Manage Analytics Sharing, View Collected Analytics Data or Reset Analytics Identity from the command palette. Reset disables sharing; it does not delete data already received by PostHog. The standalone graph-file viewer has no analytics collector. The packaged telemetry.json lists the allowed fields.

Consented events go to tensorViz's PostHog EU project, with one-year retention under the current plan. IP storage is disabled and person profiles are not created; network infrastructure still processes connection metadata. For private analytics questions or deletion requests, email tensorviz.app@gmail.com. You can obtain your random installation ID from View Collected Analytics Data before resetting it. Send that ID privately if needed to locate your events; never post it in a public question. All model features work with sharing off.

Support

The October 7 compatibility pass verified macOS 26.4 Apple Silicon and Ubuntu 24.04.5 x86_64 on personal RunPod with Python 3.10–3.14 and Torch 2.14.1. Windows, other OS releases/architectures, CUDA and free-threaded Python remain unverified in this pass. Linux installed checks used VS Code with a virtual display; native Linux desktop interaction was not certified. Python 3.15 is experimental. Expression-level source edits require Python 3.11+; Python 3.10 still captures models. See the compatibility details. Managed runtimes are available for macOS Apple Silicon, Windows x64 and Linux x64; other architectures need a compatible existing Python environment.

Desktop Remote SSH is supported too: install tensorViz on the SSH host and select Python there. For a coding agent on your desktop, use Forward MCP to This Desktop. See SSH setup and platform details for runtime requirements and other environment limits.

TensorViz's own code uses the MIT license. The bundled tldraw SDK and assets retain their separate licenses. LICENSE and THIRD_PARTY_NOTICES.md ship in the extension. The source repository is private; repository access is not required to install or use tensorViz.

Getting started · Platform compatibility · Questions and bug reports · Troubleshooting

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft