Gul*_*zar 5 python gpu pytorch tensor
我有张量
t = torch.zeros((4, 5, 6))
如何检查它是否在gpu上?
Gul*_*zar 12
来自 pytorch 论坛
用 t.is_cuda
t.is_cuda
t = torch.randn(2,2) t.is_cuda # returns False t = torch.randn(2,2).cuda() t.is_cuda # returns True
归档时间:
4 年,9 月 前
查看次数:
4785 次
最近记录: