KFrank:

The various .to('cuda:0') calls “break the computation graph”
(unless the tensors in question are already on 'cuda:0' , in which
case they’re a no-op), and .detach().numpy() in any event breaks
(that part of) the computation graph.


Looking at the documentation, it seems that I should make use of the tensor.clone() function to keep connection with the computation graph. Would you confirm?