Closed
[Documentation|文档反馈]: 39个算子proto.h注释存在拼写与语法错误 #3234
sun-yibo1Add on  Sep 18Closed at  14 days ago
sun-yibo1Collaborators
Sep 18 Create

一、文档链接 (必填)

以下 39 个算子原型注释文件(cann/ops-math master,基线 5a833dca6):

  • math/{add,sub,mul,muls,div,real_div,floor_div,div_no_nan,pow,minimum,maximum,signbit,less,less_equal,greater,greater_equal,not_equal,equal,bias_add,squared_difference,lerp,logical_and,logical_or,bitwise_or,bitwise_and,bitwise_xor,tanh_grad,axpy,axpy_v2,addcmul,addcdiv,select,select_v2,mod,floor_mod,ger,gcd}/op_graph/*_proto.h
  • conversion/clip_by_value/op_graph/clip_by_value_proto.h、conversion/clip_by_value_v2/op_graph/clip_by_value_v2_proto.h

二、问题文档片段 (必填)

1. 拼写错误(4 处)

  • math/select_v2/op_graph/select_v2_proto.h:28:
    If condittion is true, outputs will be set as then. If condittion is false, ...(condittion → condition,2 处)
  • math/axpy_v2/op_graph/axpy_v2_proto.h:34:
    whose shape is generated after 'x1', 'x2' broadcast opratioan.(opratioan → operation)
  • conversion/clip_by_value/op_graph/clip_by_value_proto.h:27:
    ... float32, float16, int16,(英文 dtype 列表中混入全角逗号)

2. 系统性语法错误(历史模板复制扩散)

  • @brief ... Support broadcasting operations.(应为 Supports):27 个文件
  • A ND Tensor / A ND tensor(ND 以元音发音,应为 An ND):33 个文件 97 处

3. 单文件语法错误(约 71 处,节选)

文件:行 原文 问题
ger:29 The input x1 and x2 has to be a 1D vector.Inputs include: has→have;句号后缺空格
addcmul:25 / addcdiv:25 multiply the result by the scalar value and add it to... 与 Performs 不平行,应为 multiplies/adds
muls:36 value: An required attribute. 冠词错误,应为 A required
equal:24 Returns the truth value of (x = y) 输入名为 x1/x2 且下文写 x1 == x2,应为 (x1 == x2)
lerp:35 y: A ND tensor with the same dtype of start's. 语法破碎,应为 the same dtype as start
bias_add:31 A 1D tensor with size the C dimension of x: 应为 with a size equal to the C dimension of x
gcd:24 Returns x1 and x2 greatest common divisor element-wise. 语序错误
signbit/less/less_equal/greater/greater_equal aicore accuracy is not guaranteed 应为 AiCore
mod:37 / floor_mod:40 in the mini form. / in the mini platform 两文件表述互相矛盾,必有一错
mul(Constraints) "x1" and "x2" have incompatible shapes or types. 把报错条件写成约束,语义颠倒
div_no_nan:28 types:float16 / "x1".The shapes 冒号/句号后缺空格
squared_difference:37 / bitwise_xor:35 Compatible with TensorFlow operator ... 缺冠词 the
bitwise_xor:24 Elementwise computes 与 bitwise_or/and 的 Element-wise 不一致
gcd:40 the Torch operator Gcd 应为 PyTorch

💡 存在的问题

以上均为注释(文档)缺陷,无代码逻辑影响;但 proto.h 注释会进入算子原型文档/接口说明生成链路,拼写与语法错误直接影响对外文档质量。修复 PR 见下方关联。

关联 PR:https://gitcode.com/cann/ops-math/pulls/5815

likedislike
Ssun-yibo1Collaborators
Sep 18 Modify description of issue
Xxujiachen8Collaborators
Sep 20 Assign sun-yibo1 as responsible person
陈思
陈思Collaborators
16 days ago Comments:

您好,感谢反馈!

已核对 cann/ops-math 提交 b19eaee4f58e5e1e3cb3b2ecbfed2d02c11c820a:SelectV2 原型注释仍有 condittion,AxpyV2 注释仍有 opratioan;Mul 的约束说明也将输入不兼容写成了约束条件。这些表述会影响原型资料的准确性,应区分纯拼写修正与约束语义修正。

已关联的 PR !5815 涉及 39 个原型文件,实际修改包括 condition、operation、Supports、An ND 等拼写/语法,以及将 Mul 约束明确为输入形状和类型必须兼容。该 PR 当前仍未合入;此单按资料一致性问题继续跟踪,涉及算子支持范围的说明仍以相应注册和实现为依据。

likedislike
CANN-robotCANN-robotCollaborators
14 days ago Close issue
CANN-robotCANN-robotCollaborators
14 days ago Added label: resolved