Skip to main content

tinyviz

Graph recorder and visualization helpers for tinygrad tensors.

Example Graph

Code for the Image

Note the order of execution and the variable names in the image from the code

def add_stuff(a, b):
    c = a * b
    d = a * c
    return d

a1 = Tensor([[1, 2], [1, 3]])
b1 = Tensor([-10, 255])

z = a1 * a1

add_stuff(a1, b1)

Installation

pip install tinyviz

Usage

from tinygrad import Tensor
from tinyviz import graph

# Record tensor operations
with graph:
    a = Tensor([[1, 2], [3, 4]])
    b = Tensor([[5, 6], [7, 8]])
    c = a + b
    d = c * a

# Display the graph in Jupyter
graph

Features

  • Automatic operation recording: Tracks tensor operations inside context managers
  • Beautiful visualizations: Clean, dark-themed graphs with color-coded values
  • Jupyter integration: Displays directly in notebooks
  • Variable name inference: Automatically captures tensor names from your code
  • Multiple themes: Switch between dark and light modes

API

Context Manager

with graph:
    result = my_computation()

graph  # Display

Reset

graph.reset()

Decorator

@graph.capture
def my_function(x, y):
    return x + y

Manual Control

graph.start()
result = my_computation()
graph.stop()
graph  # Display

Theme Control

graph.dark()   # Dark theme (default)
graph.light()  # Light theme

License

Apache 2.0

Metadata

Release files for tinyviz 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tinyviz 0.1.1
File Size Uploaded
tinyviz-0.1.1.tar.gz 355.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tinyviz 0.1.1
File Interpreter ABI Platform
tinyviz-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 373.0 kB

Release files / tinyviz-0.1.1.tar.gz

Download URL tinyviz-0.1.1.tar.gz
Size 355.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f118b30b13cefcc3dc9bf6e75ea161e23641bf01665a0b1cd123384804e43c4e
BLAKE2b-256 checksum
How to use checksums
b0ae8eac6d3dcff8f576ec7d7247b62deb8b1cfdb5ae7152a6f9d2c72d757843
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / tinyviz-0.1.1-py3-none-any.whl

Download URL tinyviz-0.1.1-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09463487e21dcdec92599fd5a3e653cf058651fc084def60735531328e93c125
BLAKE2b-256 checksum
How to use checksums
77c69474bd107e42c49d1cafeed131e3b19095f4d86590b4e2cd3418d9faddac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page