Skip to main content

Graph recorder and visualization helpers for tinygrad tensors.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyviz-0.1.1.tar.gz (355.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyviz-0.1.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file tinyviz-0.1.1.tar.gz.

File metadata

  • Download URL: tinyviz-0.1.1.tar.gz
  • Upload date:
  • Size: 355.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tinyviz-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f118b30b13cefcc3dc9bf6e75ea161e23641bf01665a0b1cd123384804e43c4e
MD5 38c6edb4e53c1baa942eda9879296182
BLAKE2b-256 b0ae8eac6d3dcff8f576ec7d7247b62deb8b1cfdb5ae7152a6f9d2c72d757843

See more details on using hashes here.

File details

Details for the file tinyviz-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tinyviz-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tinyviz-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09463487e21dcdec92599fd5a3e653cf058651fc084def60735531328e93c125
MD5 42c2662e0c900f6982137351ef5da946
BLAKE2b-256 77c69474bd107e42c49d1cafeed131e3b19095f4d86590b4e2cd3418d9faddac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page