Open
【11月贡献大赛-缺陷修复】fix(ops-precision-standard): [Bug] fix empty batch crash, fp16/uint8 diff overflow, shape broadcast, and NaN/Inf handling in mare_mere_threshold.py #7335
【11月贡献大赛-缺陷修复】fix(ops-precision-standard): [Bug] fix empty batch crash, fp16/uint8 diff overflow, shape broadcast, and NaN/Inf handling in mare_mere_threshold.py #7335
Open
liuhongweiAdd on 3 hours ago
liuhongwei
liuhongwei
3 hours ago

关联 Issue

  • 无(社区自测发现的脚本缺陷修复)

改动说明

  • 在 skills/optimization/ops-precision-standard/scripts/mare_mere_threshold.py 中新增 _prepare_pair() 校验张量形状一致与非空并转为 np.float64 后计算差值,防止 float16 差值溢出及 uint8 无符号下溢回绕,并杜绝静默广播掩盖形状错误。
  • 在 check_precision_threshold() 中显式检测 NaN / Inf,发现非有限值时强制判定 is_pass=False 并记录原因;返回字段统一转为原生 Python bool/float。
  • 修复 check_precision_threshold_batch([]) 空批次调用 np.mean/np.max 报错的问题。
  • 新增回归单元测试 skills/optimization/ops-precision-standard/tests/test_mare_mere_threshold.py。

改动类型

自检清单

测试结果

python -m pytest -q skills/optimization/ops-precision-standard/tests/test_mare_mere_threshold.py
# 4 passed in 0.19s
likedislike
Merge blocked
ascend-robotascend-robotCollaborators
3 hours ago Added label: ascend-cla/yes
ascend-robot
ascend-robotCollaborators
3 hours ago Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.


PR Approval Progress

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
sig-model-agent ❌ (0/2)(You can also ask: 林泽毅, 花新宇, 焦泽昱, 张玉橙, starmountain) ❌ (0/1)(You can also ask: 胡晓曼, 林泽毅, 刘磊, 顾梦沁, 焦泽昱)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

liuhongwei-2026, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike