0
点赞
收藏
分享

微信扫一扫

torch.Tensor和torch.tensor有什么区别?


问题

写代码的时候碰到过这个错误:

torch.Tensor和torch.tensor有什么区别?_深度学习

TypeError: new() received an invalid combination of arguments - got (list, dtype=torch.dtype), but expected one of:

原因

那么到底是hi什么原因呢? ​torch.Tensor()​torch.tensor()​ 写法会导致得到的tensor具有不同的数值类型。 具体示例如下:

torch.Tensor和torch.tensor有什么区别?_python_02


举报

相关推荐

0 条评论