szagoruyko / pytorchviz

A small package to create visualizations of PyTorch execution graphs
MIT License
3.24k stars 279 forks source link

Inconsistent arrow directions for saved variables #61

Closed Varal7 closed 3 years ago

Varal7 commented 3 years ago

For saved variables created in a custom autograd function, the direction SavedVariable -> Node is used. (cf. https://github.com/szagoruyko/pytorchviz/blob/master/torchviz/dot.py#L141)

For the other ones, no direction is used (cf. https://github.com/szagoruyko/pytorchviz/blob/master/torchviz/dot.py#L110 and https://github.com/szagoruyko/pytorchviz/blob/master/torchviz/dot.py#L116)

albanD commented 3 years ago

cc @soulitzer

soulitzer commented 3 years ago

This is a good catch. We should probably just remove the direction for the custom function case as well, since it's bad for arrows to have multiple meanings in the same graph.