Are there some differences between .cuda() and to(torch.device('cuda'))?

As mentioned above, we use .cuda() in pytorch 0.3, but we can use .to(torch.device(‘cuda’)) in 0.4 too.
Are there some differences between them? Like speed? Thanks.

1 Like

Hi,

No they are the same. .to() is the new version that is more versatile as it take amy device as input.

5 Likes