You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this second image the blue node and the two orange nodes are merged into one.
I'm opening this issue to discuss how we would to fix this.
One option is to revert back to the old behavior by giving unique names to each node (so something like dot.node(SAVED_PREFIX + attr + str(id(val)), get_var_name(val, attr), fillcolor='orange')).
The drawback is that the user loses the information that those three nodes are indeed backed by the same tensor.
Another option would be to draw a dotted edge between the saved variable and its base, for instance:
From offline discussion, I think the dotted line version is nice.
Note that this actually exposes some "internal" autograd stuff as these Tensors being the exact same python object or not is only true for non-outputs.
Maybe we could change the way we do this detection and use tensor.data_ptr() to detect if SavedVariables ever match another Tensor already here. And use dotted lines between them (to specify they are views of each other).
The commit pytorch/pytorch@1efa863 changes the way variables are saved during the forward (in certain cases).
This can create comical graphs when visualized with torchviz because the saved variable shares the same id as the input.
For instance:
Before:
After pytorch/pytorch@1efa863:
In this second image the blue node and the two orange nodes are merged into one.
I'm opening this issue to discuss how we would to fix this.
One option is to revert back to the old behavior by giving unique names to each node (so something like
dot.node(SAVED_PREFIX + attr + str(id(val)), get_var_name(val, attr), fillcolor='orange')
).The drawback is that the user loses the information that those three nodes are indeed backed by the same tensor.
Another option would be to draw a dotted edge between the saved variable and its base, for instance:
cc @soulitzer @albanD
The text was updated successfully, but these errors were encountered: