Solved by tymokvo in post #2 
              
              
                Welcome to the forums! 
You have probably noticed that PyTorch can only implicitly create gradients for scalar outputs. Thus, you need to combine them in some way that will make a loss calculation meaningful for your task. A simple objective function like nn.MSELoss might be a good place to start. 
Y…