name | about | labels |
---|---|---|
Bug Report | Use this template for reporting a bug | kind/bug |
Ascend
/GPU
/CPU
):Uncomment only one
/device <>
line, hit enter to put that in a new line, and remove leading whitespaces from that line:
/device gpu
mindspore.ops.sum在bool类型时与torch.sum返回结果不一致,有误
API映射表表明其mindspore.ops.sum与torch.sum返回结果一致,有误导性
测试代码如下:
import numpy as np
import torch
from mindspore import Tensor, ops
from mindspore import dtype as mstype
input = np.array([[True, False, False, True, True], [True, False, False, True, True], [True, False, False, True, True],
[True, False, False, True, True], [True, False, False, True, True], [True, False, False, True, True],
[True, False, False, True, True], [True, False, False, True, True], [True, False, False, True, True]])
m_x = Tensor(input, mstype.bool_)
t_x = torch.tensor(input, dtype=torch.bool)
m_out = ops.sum(m_x, dim = 0)
t_out = torch.sum(t_x, dim = 0)
print(m_out, t_out)
m_out = ops.sum(m_x, dim = 1)
t_out = torch.sum(t_x, dim = 1)
print(m_out, t_out)
[ True False False True True] tensor([9, 0, 0, 9, 9])
[ True True True True True True True True True] tensor([3, 3, 3, 3, 3, 3, 3, 3, 3])
请问其不一致是设计算子的本意吗?API映射表注明“功能一致,参数名不同”是否存在误导?
Please assign maintainer to check this issue.
请为此issue分配处理人。
@fangwenyi @chengxiaoli @Shawny
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
感谢您的反馈,您可以评论//mindspore-assistant更快获取帮助,更多标签可以查看标签列表:
你好,问题已复现,目前相关责任人正在分析
和相宜沟通影响可控,遗留到2.2版本解决
最新master版本已经修复,gpu结果与torch一致
torch.sum与ops.sum api差异说明修改为一致
https://e.gitee.com/mind_spore/repos/mindspore/docs/pulls/12963
9月21日的master版本
您好,该问题已修复,您可以编译master分支代码使用或等待MindSpore发布下一个版本通过官网whl包安装使用,如您仍有疑问可将问题单状态改为WIP,我们会进一步跟踪
登录 后才可以发表评论