I would like to convert a Pytorch tensor to numpy array using cuda:
this is the code line while not using cuda:
A = self.tensor.weight.data.numpy()
How can I do the same operation using cuda? According to this: https://discuss.pytorch.org/t/how-to-transform-variable-into-numpy/104/3 it seems:
A = self.tensor.weight.data.cpu().numpy()