Thanks! Really appreciate you taking the time to figure that out.
How should I detach() the results of the initialization? I have done:
concentrations, means, covariances, precisions = initialization(net.forward_one(data))
concentrations = (concentrations[0].detach(),  concentrations[1].detach())
means = means.detach()
covariances = covariances.detach()
precisions = precisions.detach() 

But I’m still experiencing the same slowing of each iteration as I proceed through the loop. The same thing happens if I wrap the initialization with a torch.no_grad().