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

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有什么区别?问题原因的全部内容,更多相关torch内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复