@albanD, Thanks.
Could you explain the second question for me?

Besides, torch.to() seemingly not a in-place operation, which means, it’s different from .cuda(), So i feel confused since the migration guide told us to us .to() to replace .cuda()?

in pytorch 0.3, we can write
a = torch.Tensor(...)
a.cuda()

but in python 0.4, we need
a = torch.Tensor(...)
a = a.to(device)

So .to() is not in-place operation?