摘要:
把数据从CPU迁移到GPU时,可以用.cuda()方法,也可以用.to(device)方法。示例如下。 .cuda()方法 import torch import time t = time.time() b = torch.rand([1024, 1024, 10]) b = b.cuda() p 阅读全文
posted @ 2020-09-29 14:57
Picassooo
阅读(11253)
评论(7)
推荐(2)
摘要:
参考一 浅谈 PyTorch 中的 tensor 及使用 该博文分为以下6个部分: tensor.requires_grad torch.no_grad() 反向传播及网络的更新 tensor.detach() CPU and GPU tensor.item() torch.detach()和tor 阅读全文
posted @ 2020-09-29 11:04
Picassooo
阅读(2804)
评论(0)
推荐(1)

浙公网安备 33010602011771号