This error means that you computed something once and used it in multiple forward passes and thus multiple backward pass.
Make sure that  your forward pass only uses the original tensor that you created with requires_grad=True (a leaf Tensor) and not intermediary results.
In your case, as I said, U should be recomputed at every forward pass !