pytorch模型迁移中mindspore.ops.matmul参数问题
收藏回复举报
pytorch模型迁移中mindspore.ops.matmul参数问题
t('forum.solved') 已解决
发表于2023-10-31 14:58:07
0 查看

pytorch模型迁移Mindspore过程中,原pytorch代码的矩阵相乘操作没有问题,而在mindspore中则参数类型错误

TypeError: For matmul op, inputs must be all tensors.

其中,ent_ent为SparseTensor,he_emb为Tensor

torch.matmul(ent_ent, he_emb)
mindspore.ops.matmul(ent_ent, he_emb)

想要运行是必须两个都是Tensor吗

我要发帖子