pytorch numpy 转换成 tensor ——》 torch.from_numpy()

sub_ts = torch.from_numpy(sub_img) #sub_img为numpy类型

おすすめ

転載: blog.csdn.net/Hodors/article/details/120846867