GitXplorerGitXplorer
s

pytorchviz

public
3273 stars
280 forks
34 issues

Commits

List of commits on branch master.
Verified
5cf04c13e601366f6b9cf5939b5af5144d55b887

Add github CI (#87)

sszagoruyko committed 19 days ago
Verified
0adcd83af8aa7ab36d6afd139cabbd9df598edb7

Remove edge direction for saved_tensors (#63)

VVaral7 committed 4 years ago
Verified
1e81953d2a21a94406516e3d9099f3cb3fb2a494

Fix saved_tensors merged into a single graphviz node (#62)

VVaral7 committed 4 years ago
Verified
5c91c3d52451f22af1a388993b798eaac1e0a74c

bump to 0.0.2! (#55)

aalbanD committed 4 years ago
Verified
58b135a3f85a11845e32a4aa454410f61da2f96a

remove all jit trace related code and examples (#54)

aalbanD committed 4 years ago
Verified
140225b131c1c14239c6dd8da4330bb4b8f46130

add open in colab badge (#52)

sszagoruyko committed 4 years ago

README

The README file for this repository.

PyTorchViz

A small package to create visualizations of PyTorch execution graphs and traces.

Open In Colab

Installation

Install graphviz, e.g.:

brew install graphviz

Install the package itself:

pip install torchviz

Usage

Example usage of make_dot:

model = nn.Sequential()
model.add_module('W0', nn.Linear(8, 16))
model.add_module('tanh', nn.Tanh())
model.add_module('W1', nn.Linear(16, 1))

x = torch.randn(1, 8)
y = model(x)

make_dot(y.mean(), params=dict(model.named_parameters()))

image

Set show_attrs=True and show_saved=True to see what autograd saves for the backward pass. (Note that this is only available for pytorch >= 1.9.)

model = nn.Sequential()
model.add_module('W0', nn.Linear(8, 16))
model.add_module('tanh', nn.Tanh())
model.add_module('W1', nn.Linear(16, 1))

x = torch.randn(1, 8)
y = model(x)

make_dot(y.mean(), params=dict(model.named_parameters()), show_attrs=True, show_saved=True)

image

Acknowledgements

The script was moved from functional-zoo where it was created with the help of Adam Paszke, Soumith Chintala, Anton Osokin, and uses bits from tensorboard-pytorch. Other contributors are @willprice, @soulitzer, @albanD.