device = torch.device('cuda')
torch.rand(8,1).to(device)
原因在于torch函数生成的tensor需要转到GPU上
立减 ¥
请填写红包祝福语或标题
红包个数最小为10个
红包金额最低5元
抵扣说明:
1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。