I have a tensor
t = torch.zeros((4, 5, 6))
How to check if it is on gpu or not?
I have a tensor
t = torch.zeros((4, 5, 6))
How to check if it is on gpu or not?
use t.is_cuda
t = torch.randn(2,2)
t.is_cuda # returns False
t = torch.randn(2,2).cuda()
t.is_cuda # returns True