I have a pytorch Tensor of size torch.Size([4, 3, 966, 1296])
pytorch
torch.Size([4, 3, 966, 1296])
I want to convert it to numpy array using the following code:
numpy
You can use this syntax if some grads are attached with your variables.
y=torch.Tensor.cpu(x).detach().numpy()[:,:,:,-1]