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 differentiable manner if you want to be able to use it. Not sure how you can do that though.