您的位置: 首页 > 文章 > pytorch中int和float如何进行转化? pytorch中int和float如何进行转化? 分类: 文章 • 2024-10-18 09:21:10 优先使用:**torch.tensor(已有数据,dtype=torch.float)**这个方法比较好 可以看例子。这也可以反向运行。 实际上torch.FloatTensor()的输入最好是列表等,而不是一个数字。