源代码:h[i][j]=h[i][j].view(self.hidden_dim*2,1)
发生异常: RuntimeError:
expand(torch.FloatTensor{[600, 1]}, size=[600]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)
请问大家,我这里哪里出错了?
pytorch关于修改数据shape时出现的问题
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
m0_61899108 2022-11-07 00:30关注h[i][j]的shape为[600,1],你view之后的shape为[600,2],整体的数量都变了,6001 != 6002,所以会报错。
解决 无用评论 打赏 举报