| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
tensor-viz is a local tensor viewer for NumPy arrays. You can inspect N-dimensional tensors, slice/permute them, and color them however you want.
Create and activate a Python environment.
python -m venv .venv
source .venv/bin/activateOn Windows PowerShell use:
.venv\Scripts\Activate.ps1Install the Python package in editable mode.
pip install -e .Install the frontend dependencies and build the static assets once for the checkout.
npm install
npm run buildRun the demo script.
python demo.pyThe npm run build step is required in a source checkout because the Python server serves the built frontend from python/src/tensor_viz/static/.
Install the workspace dependencies.
npm installStart the Vite dev server.
npm run devIn another shell, activate the Python environment and run a viewer session.
python demo.pyUse npm run build when you need to refresh the packaged static assets consumed by the Python package.
Install the docs dependencies and build both doc systems locally:
pip install -e ".[docs]"
npm install
npm run docsThe Sphinx site is written to docs/_build/html, and the embedded TypeDoc site is written to docs/_build/html/_typedoc.
import numpy as np
import tensor_viz
x = np.random.randn(32, 64, 64)
tensor_viz.viz(x) # launches an HTTP server with a web UI to view the tensorlabels= is optional. When omitted, axes default to A B C ... Z A0 B0 .... Custom labels must start with one letter and may only use non-letters after it, so C, B0, and T11 are valid while Batch is not.
The main Python entrypoints are:
demo.py contains runnable examples for single tensors, metadata-only tensors, sequences, mappings, tabs, labels, prebuilt sessions, and session lifecycle options.
tensor-viz is split into four API layers:
The Python and TypeScript session-builder surfaces target the same session model, but they are intentionally different:
The shared TypeScript session-builder layer lives in packages/viewer-core. It exports manifest builders such as createBundleManifest(...), createSessionBundleManifest(...), and the shared manifest/view/tensor types through packages/viewer-core/src/index.ts.
The full demo shell can be embedded through @tensor-viz/viewer-demo via mountDemoApp(container, options). The current mount API is iframe-backed, so host apps can embed the whole demo page without directly managing the demo DOM.
The same packages/viewer-core package also exports the imperative browser viewer engine: TensorViewer, tensor mutation methods, view APIs, hover subscriptions, and snapshot/state helpers.
Generate the TypeScript API reference with:
npm run docs:tsThat command writes the standalone TypeDoc site to docs/_extra/_typedoc.
The repo includes .readthedocs.yaml plus a Sphinx docs tree under docs/. Read the Docs can build the Python docs and pre-generate the embedded TypeDoc site from the repository root without extra project-specific scripting.
| Back | FazBrowse Home | New Git URL |