登录社区云,与社区用户共同成长
邀请您加入社区
【代码】pytorch 修改tensor数据类型。
import torch a = torch.randn(3, 200, 200) print(a.dtype) b = a.type(torch.float16) print(b.dtype) c = a.type(torch.int32) print(c.dtype) d = a.type(torch.long) print(d.dtype) e = a.type(torch.float32) print(e.dtype)
汇聚全球AI编程工具,助力开发者即刻编程。
更多推荐
“不读代码“的开发哲学:Vibe Coding 是终极生产力还是定时炸弹?
2026最新版Claude Code安装使用指南
国内AI编程IDE对比(二):从零构建桌面应用实测
扫一扫分享内容
所有评论(0)