Could you specify exactly what you mean by “part of the graph”? I will not modify out1 after finding it as shown above, if that is the concern.

Yeah that’s what I meant.



 raunaks:

What if I wanted to get the value of out1 for the second Block in Sequential? Is there a way to specify this by just using a global variable?


You can just create another global called block2out1 and write the values into that tensor
Most torch operations have an argument out which specify where the output answer should be written to
In your case above, you could write out1.data = out.data and that copies out’s values