I use to do it like this: net(im).detach().cpu().numpy() until I got to know detach() allows two tensors have a same data which I believe means that if I change one another will be modified.
What is the correct way to store the result of a model, for example, the loss or the embeds ?