to.(device) not working putting tensor to gpu but .cuda() works fine.
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print device
img = torch.randn(100, 1)
img.to(device)
print img.device
this print cpu.
to.(device) not working putting tensor to gpu but .cuda() works fine.
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print device
img = torch.randn(100, 1)
img.to(device)
print img.device
this print cpu.
got the reason of the abnormal behaviour.