虽有宝刀,藏而不用

银鞍白马

日拱一卒

随笔分类 -  pytorch学习

摘要:1. RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'mat2'(期望对象为标量类型长,但得到标量类型浮点数) y= torch.matmul(x,w) 解决:y 阅读全文
posted @ 2019-09-08 10:16 银鞍白马 阅读(435) 评论(0) 推荐(0)
摘要:1. t.Tensor 和t.tensor的不同 t.Tensor(size)可以直接创建形为size的张量 t.tensor()需要t.tensor([1, 2])创建. 不论输入的类型是什么,t.tensor都会进行数据拷贝,不会共享内存 2. resize()和view()的不同 resize 阅读全文
posted @ 2019-09-08 10:15 银鞍白马 阅读(153) 评论(0) 推荐(0)