pytorch tensor 数据类型转换

Y = torch.from_numpy(wipeAndPupil).to(X.device) # wipeAndPupil 从numpy转换为tensor
Y=Y.type(torch.cuda.FloatTensor)
posted @ 2022-03-20 21:36  bH1pJ  阅读(63)  评论(0)    收藏  举报