Solved by albanD in post #2 
              
              
                Hi, 
When you do .item() on the y_pred element, you actually convert the Tensor into a python float for which we cannot track gradients. 
So no gradient can flow back all the way to your model. 
You will need to make sure center_circle_gen takes a Tensor as input and generates the output in a differ…