Thank you! This solved the problem 
So in general I can write something like
for idx in range(100):
   var1 = network(var1)

but if I try to assign only part of the variable (making it an inplace operation) then it doesn’t work anymore. Right?