| docs: 统一三个 math 算子文档格式并补充 example 空张量用例与 shape 校验
Co-authored-by: tangpingchuan<tangpingchuan@huawei.com>
# message auto-generated for no-merge-commit merge:
!3050 merge master into master
docs: 统一三个 math 算子文档格式并补充 example 空张量用例与 shape 校验
Created-by: pingchuantang
Commit-by: tangpingchuan
Merged-by: cann-robot
Description: ## 描述
本 PR 对 math 下 fused_mul_add、fused_mul_add_add、mul_no_nan 三个算子的文档与 example 测试做规范化与增强,不涉及 kernel 计算逻辑变更。
主要改动:
1. README 文档规范化(三个算子统一)
- 功能说明:精简描述,去除加粗噪声,统一行文。
- 参数说明:由 Markdown 表格统一改为标准 HTML <table> 格式(固定列宽、“输入/输出/属性”表头、dtype 用“同x1”表述)。
- 约束说明:整理措辞并补充语义说明。
2. example 测试增强(三个 test_geir_*.cpp)
- 新增输出 shape 校验:依据 outShape 计算期望 numel,与实际输出 numel 比对,不一致打印 "SHAPE MISMATCH" 并计入失败。
- 新增空 tensor(numel==0)用例:fp32_empty、fp32_empty_bc。
3. fused_mul_add_add 约束澄清
- proto.h 接口注释 + README 约束说明明确:x1 必须为完整输出 shape,x2/x3/x4 向上广播到 x1;当前 runtime 不支持 x1 自身向上广播(如 x1=[1]、x3=[3,4]),该类用例在 RunGraph 阶段失败。
- example 移除依赖“x1 向上广播”的 4 个用例(fp32_bc_scalar / fp32_bc_rowcol / fp32_bc_3d / fp16_bc_mixed),它们暴露的是 runtime 限制。
## 关联的Issue
- #1752
## 测试
- example 覆盖 fp32/fp16/int32/bf16 基础用例、广播用例、关键特殊值(0·inf、0·NaN、-0);本 PR 新增空 tensor 用例与输出 shape 校验。
## 文档更新
- 更新 fused_mul_add/README.md、fused_mul_add_add/README.md、mul_no_nan/README.md。
- 更新 fused_mul_add_add/op_graph/fused_mul_add_add_proto.h 接口注释。
## 类型标签
- [x] 文档更新
- [x] 其他:增强 example 测试覆盖(空 tensor 用例 + 输出 shape 校验)
See merge request: cann/ops-math!3050 | 1 天前 |