Skip to main content

Record execution graphs of PyTorch neural networks

Project description


A small package to record execution graphs of neural networks in PyTorch. The package uses hooks and the grad_fn attribute to record information.
This can be used to generate visualizations at different scope depths.

Licensed under MIT License. View documentation at



Install this package:

$ pip install torchrec


This is inspired from szagoruyko/pytorchviz. This package differs from pytorchviz as it provides rendering at multiple depths.

Note that for rendering a network during training, you can use TensorBoard and torch.utils.tensorboard.SummaryWriter.add_graph, which records and renders to a protobuf in a single step. The intended usage of pytorchrec is for presentation purposes.

Project details

Download files

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

Files for torchrec, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size torchrec-1.0.1-py3-none-any.whl (12.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size torchrec-1.0.1.tar.gz (10.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page