How livia-tassel/tensorv works
TensorV is a PyTorch tensor-inspection workspace: users edit or load Python code, run it, select recorded statement snapshots, and inspect tensor values, layout, and statistics. The browser frontend sends execution and slice requests to either the local HTTP service or the VS Code host bridge; the Python engine records bounded snapshots and diagnoses shape errors. Sharing and examples support the workspace, while the VS Code extension adds interpreter selection and live source binding. Public execution adds a sandboxed service path. Some subsystem links are based on README documentation because their implementation excerpts were not provided.
Main entry points: main.js Workspace controller · engine.py Execution and snapshots · extension.cjs Extension host · sharing.js Experiment sharing
Components 19
Workspace UI
- Workspace controller
src/main.js - Script manager
src/scripts.js - Workspace layout
src/layout.js - Example library
src/examples.js - Experiment sharing
src/sharing.js - Experiment format
src/experiments.js
Tensor analysis
- Execution and snapshots
tensorv/engine.py - Tensor slice inspection
tensorv/engine.py - Shape diagnostics
tensorv/diagnostics.py - Diagnostic rendering
src/diagnostics.js
Execution services
- Local HTTP service
tensorv/server.py - Public service
tensorv/public_server.py - Sandbox runner
tensorv/sandbox.py - Sandbox worker
tensorv/sandbox_worker.py
VS Code integration
- Extension host
extensions/vscode/extension.cjs - Python bridge client
extensions/vscode/lib/bridge-client.cjs - Source binding
extensions/vscode/lib/source-binding.cjs - Python bridge
tensorv/bridge.py
Other components
- User
Connections 20
- User → Workspace controller: edits and runs
README.md - Workspace controller → Local HTTP service: requests execution
src/main.js - Workspace controller → Script manager: manages scripts
src/main.js - Workspace controller → Workspace layout: renders workspace
src/main.js - Workspace controller → Example library: loads examples
src/main.js - Workspace controller → Experiment sharing: opens sharing
src/main.js - Experiment sharing → Experiment format: encodes documents
src/sharing.js - Workspace controller → Diagnostic rendering: renders diagnostics
src/main.js - Local HTTP service → Execution and snapshots: dispatches execution
tensorv/server.py - Execution and snapshots → Shape diagnostics: requests diagnosis
tensorv/engine.py - Workspace controller → Tensor slice inspection: requests slices
README.md - User → Extension host: runs editor code
README.md - Extension host → Python bridge client: starts bridge
extensions/vscode/extension.cjs - Python bridge client → Python bridge: sends requests
- Python bridge → Execution and snapshots: dispatches actions
tensorv/bridge.py - Extension host → Source binding: binds source
extensions/vscode/extension.cjs - User → Public service: uses public workspace
README.md - Public service → Sandbox runner: runs isolated code
tensorv/public_server.py - Sandbox runner → Sandbox worker: starts worker
- Sandbox worker → Execution and snapshots: executes snippets
tensorv/sandbox_worker.py