Solved by albanD in post #2 
              
              
                Hi, 
Yes the nn.Module construction makes it quite hard to be functional as it is based on the fact that the parameters are part of the state. 
But here you can cheat by removing the parameters from the module and setting the new Tensors one by one before the forward. An example is below, you should…