Suppose I have the following graph and example code.
def forward(self, x):
z = x.squeeze(0)
if __name__ == "__main__":
script = torch.jit.script(Net().eval())
print("-" * 10)
for node in script.graph.nodes():
Is the loop guaranteed to iterate over the nodes in an order that preserves the semantics of the in-place operations in the graph?
In this simple example its just enough that the add is looped over before the mul, but the general case is more important to me.
I do get the correct order when running this script, but I’m interested if this is guaranteed.