已关闭
[Bug-Report|缺陷反馈]: SmoothL1LossGrad README 第三个输入名称与接口定义不一致 #4862
zhongheng创建于  16 天前关闭于  15 天前
zhongheng
16 天前 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

SmoothL1LossGrad 的需求文档、CANNDEV 原型、op_graph、op_host 及构建生成的 binary.json 均将第三个输入定义为 dout,但 loss/smooth_l1_loss_grad/README.md 的计算公式、参数表、dtype 约束和 shape 约束中使用了 gradOutput,导致 README 与实际接口定义不一致,容易造成测试及用户理解偏差。

Environment / 环境信息 (Mandatory / 必填)

  • 硬件:Ascend950DT(该问题为文档一致性问题,与具体硬件无关)
  • CANN:9.2.0
  • 仓库:cann/ops-nn
  • 基线:origin/master,提交 5e7f4bf1b603cec432475b388935f6293bad3505
  • 算子目录:loss/smooth_l1_loss_grad

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. 检出 ops-nn 最新 master。
  2. 查看 loss/smooth_l1_loss_grad/README.md,可见第 20、31、38、39 行使用 gradOutput
  3. 对比以下接口定义:
    • op_graph/smooth_l1_loss_grad_proto.h.INPUT(dout, ...)
    • op_host/smooth_l1_loss_grad_def.cppInput("dout")
    • CANNDEV nn_norm_ops.h.INPUT(dout, ...)
    • 构建生成的 smooth_l1_loss_grad_binary.json:第三个输入 "name": "dout"
  4. 确认 README 与实际接口名称不一致。

Describe the expected behavior / 预期结果 (Mandatory / 必填)

README 中第三个输入的名称应统一为 dout,与需求文档、CANNDEV 原型、op_graph、op_host 和 binary.json 保持一致。

README 当前内容:

  • 公式:... × gradOutput
  • 参数表:gradOutput
  • dtype 约束:predict、label、gradOutput
  • shape 约束:predict、label、gradOutput、gradient

实际接口:

  • REG_OP(SmoothL1LossGrad).INPUT(dout, ...)
  • this->Input("dout")
  • binary.json:{"name": "dout", "index": 2}

最新 .pre-commit-config.yaml 已在 codespell 的 -L 白名单中加入 dout,使用 dout 不再触发拼写检查失败。

Special notes for this issue/备注 (Optional / 选填)

likedislike
zhongheng
16 天前 评论:

/assign

likedislike
Zzhongheng
16 天前 关联了pull request:修复 SmoothL1LossGrad README
CANN-robotCANN-robot成员
16 天前 将 zhongheng 设为负责人
CANN-robotCANN-robot成员
15 天前 关闭了 issue
CANN-robotCANN-robot成员
15 天前 添加了label:resolved