I would prefer  to use detach().cpu(), as this would detach the tensor already on the GPU and the cpu() operation won’t be tracked by Autograd. That being said, it seems to be a minor change and you shouldn’t see any differences in using any of these two approaches.