This is the function that I created. When I use this function in the network, it stops the backpropagation, the weight cannot be updated while the require_grad is true. Is it because I lose track of x in this function?
But the x and dist have a different shape, I cannot assign it to x to do backward(). Is there any advice to solve this problem?