| docs(relu6_grad): 取消广播支持,features 须与 gradients 同 shape 并补充空张量用例 Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> # message auto-generated for no-merge-commit merge: !5507 merge master into master docs(relu6_grad): 取消广播支持,features 须与 gradients 同 shape 并补充空张量用例 Created-by: pingchuantang Commit-by: tangpingchuan Merged-by: cann-robot Description: ## 描述 本 PR 收紧 relu6_grad 算子的 shape 契约:取消对 gradients/features 的 NumPy 广播支持,要求 features 与 gradients 同 shape(或为标量 [1]),backprops 始终与 gradients 同 shape。改动仅涉及算子 IR 注释、README 文档与 example 测试,不改动 kernel 计算逻辑。 主要改动: 1. IR 接口注释(op_graph/relu6_grad_proto.h) - 由 "Supports NumPy-style broadcasting" 改为 "Broadcasting is NOT supported"。 - features 约束更新为:与 gradients 同 shape,或为标量 [1]。 - backprops 输出 shape 由 "broadcast shape" 改为 "same as gradients"。 2. README.md - 功能说明、计算公式统一改用 gradients/features/backprops 命名。 - 参数说明由 Markdown 表格统一为标准 HTML <table>,features 描述明确“shape须与gradients一致,或为标量[1]”。 - 约束说明:移除“支持任意 NumPy 广播形态”,新增“不支持广播:features 的 shape 须与 gradients 完全一致,或为标量 [1]”。 - 修正样例链接路径(examples/ → examples/arch35/)。 3. example 测试(examples/arch35/test_geir_relu6_grad.cpp) - 移除全部广播用例(mutual / single-axis / scalar / cross-rank / fp16·bf16 广播 / 广播叠加特殊值,共 17 个)。 - 新增空 tensor(含 0 维)用例:fp32_empty_1d/2d/leading_dim/scalar_feat、fp16_empty_1d、bf16_empty_2d(numel==0 时仅校验图能编译并运行)。 ## 关联的Issue - #3016 ## 测试 - example 覆盖 fp32/fp16/bf16 基础用例、边界 x=0/x=6、x=NaN/±Inf 等特殊值;本 PR 移除广播用例、新增空 tensor 用例。 ## 文档更新 - 更新 activation/relu6_grad/README.md。 - 更新 activation/relu6_grad/op_graph/relu6_grad_proto.h 接口注释。 ## 类型标签 - [x] 文档更新 - [x] 其他:收紧 shape 契约(取消广播支持),同步调整 example 测试 See merge request: cann/ops-nn!5507 | 1 个月前 |