Is it though? 
Because when I checked the code (https://github.com/szagoruyko/pytorchviz/blob/46add7f2c071b6d29fc3d56e9d2d21e1c0a3af1d/torchviz/dot.py#L56 1), It felt like, there isn’t a data structure per se, but each tensor keeps a list of functions or something like that?  Isn’t that how this graph is built in the pytorchviz package?