Closed
[Documentation|文档反馈]: aclnnIsInTensorScalar 的 161002 错误码表缺 out dtype / out shape / testElement dtype 三个子项 #4248
liuhanwen8Add on 12 days agoClosed at 1 day ago
12 days ago Added label: documentation
陈思
11 days ago Comments:
11 days ago Comments:
您好,核对 ae087b184,错误码表 的 161002 说明确实没有覆盖当前实现的全部检查。
CheckDtypeValid / CheckShape 会检查 testElement 类型、out 是否为 BOOL、out 与 element 的形状是否一致,失败均由 CheckParams 返回 ACLNN_ERR_PARAM_INVALID。此外实现还检查 out 维度及推导类型是否受支持,修订时可一并对齐,避免只补三项后继续遗漏。
建议在 161002 条目补齐这些条件,保留参数表已有约束,并按产品支持列表描述类型范围。此项是返回码说明缺失,不需要改变参数校验;您提供的 910B3 结果与该路径一致,本轮未重复设备测试。


11 days ago Assign chen_0715 as responsible person
11 days ago Added label: pending-confirmation
11 days ago Removed label: pending-confirmation
11 days ago Assign sakuraqqz as responsible person
11 days ago Removed responsible person chen_0715
1 day ago Close issue
1 day ago changed custom state from 进行中 to 已完成
1 day ago Added label: resolved
现象
资料:
math/equal/docs/aclnnIsInTensorScalar.md(https://gitcode.com/cann/ops-math/blob/master/math/equal/docs/aclnnIsInTensorScalar.md#L176 )
锚点:L176-L181,
ACLNN_ERR_PARAM_INVALID/161002的两个子项。逐字原文(L176-L181,
161002用<td rowspan="2">折叠):即
161002只声明了 2 个子项,两条都只讲element。而实现的第一段接口对另外三处入参也做校验,失败时同样返回
161002,资料没有对应子项:math/equal/op_api/aclnn_isin_tensor_scalar.cpp)out数据类型不是BOOL(L146OP_CHECK_DTYPE_NOT_MATCH)out的 shape 与element不一致(L173OP_CHECK_SHAPE_NOT_EQUAL)testElement的数据类型不在支持面(L144OP_CHECK_DTYPE_NOT_SUPPORT)资料参数表已写明「
out数据类型为 BOOL。shape 与element相同」,但错误码表没有列出这两条约束被违反时的返回码;
testElement一节只写「数据类型需要与element满足数据类型推导规则」,没有写不满足时返回什么码。
期望
161002补齐 3 个子项:out的数据类型不是BOOL、out的 shape 与element不一致、testElement的数据类型不在支持范围。若错误码表有意只列element相关子项,请在「约束说明」里写明这三类不满足时同样返回
161002。环境
c171dab56e5662a3a5cf75d01f1fda8fadfd5f37(
git log --oneline -1=c171dab5 ClampMax / InplaceClampMax 增加输入越界检查)复现步骤
git clone https://gitcode.com/cann/ops-math.git && cd ops-mathrepro_isin_tensor_scalar_errtable.py(放在仓根目录)python3 repro_isin_tensor_scalar_errtable.py1= 缺陷成立([DEFECT]三行);0= 资料已补齐复现脚本
import html, re, sys DOC = "math/equal/docs/aclnnIsInTensorScalar.md" s = open(DOC, encoding="utf-8").read() t = re.search(r"第一段接口完成入参校验.*?</table>", s, re.S).group(0) rows = [] for tr in re.findall(r"<tr>(.*?)</tr>", t, re.S): cells = [html.unescape(re.sub(r"<[^>]+>", "", c)).strip() for c in re.findall(r"<td[^>]*>(.*?)</td>", tr, re.S)] if cells: rows.append(cells) descs, cur = [], None for c in rows: if len(c) >= 3: cur = c[1] or cur if cur == "161002": descs.append(c[2]) elif len(c) == 1 and cur == "161002": descs.append(c[0]) text = " ".join(descs) print("161002 子项:", descs) miss = [] if not ("out" in text and "BOOL" in text.upper()): miss.append("out 的数据类型不是 BOOL") if not ("out" in text and "shape" in text.lower()): miss.append("out 的 shape 与 element 不一致") if "testElement" not in text: miss.append("testElement 的数据类型不在支持范围") for m in miss: print("[DEFECT] 161002 缺子项:", m) sys.exit(1 if miss else 0)实测输出(
python3 repro_isin_tensor_scalar_errtable.py,masterc171dab5):退出码 1。
影响
161002时会看到文档里不存在的三种原因,容易误判成内部错误。out的 dtype / shape 有明确约束,错误码表却无对应项,两份表口径不一致。161002缺「self与out的 shape 不一致」子项)。上板佐证(Ascend 910B3 / CANN 9.2.0,第一段接口返回码):
element=fp32[4,4]、testElement=fp32(2)、out=bool[4,4]outdtype 非 BOOLout=fp32[4,4]outshape 不一致out=bool[4,8](element[4,4])testElementdtype 非法testElement以 BOOL 创建阴性对照基线两段都返回 0,说明探针本身有判据资格,这三个
161002不是构造错误。建议
在
aclnnIsInTensorScalar.md的161002行下增加 3 条子项(与 aclnnLog10 的修法一致):out的数据类型不是BOOL。/out的shape与element不一致。/testElement的数据类型不在支持范围之内。