Yeshwanth_Reddy:

Create a tensor in global scope whose shape is same a out1. Keep modifying out1, using inplace operations that operate on Model. This way you won’t need to change your forward function’s io.
I assume out1 is not part of the graph…


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.
Finally in this case would I return out1 from the forward() of the Model class?
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?
If possible could you give an example (with code)?
Thanks