已合并
fix: onnx插件解析属性时零值字段被GE省略导致回退默认值 #10783
clinglai0517创建于 9月18日
fix: onnx插件解析属性时零值字段被GE省略导致回退默认值 #10783
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 clinglai0517 的贡献)9月18日 创建了 pull request,commit 2f303416
9月18日 关联了issue:[Bug-Report|缺陷反馈]: onnx插件属性值为0时字段被GE省略导致回退默认值
9月18日 添加了label:cann-cla/yes
CANN-robot
9月18日 评论:
9月18日 评论:
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.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| activation | ✅ 刘杰, 唐超, 刘波 (3/2) | ✅ 刘杰 (1/1) |
| common | ✅ 刘波, 唐超 (2/2) | ✅ 刘波 (1/1) |
| quant | ✅ 唐超, 刘波, 刘杰 (3/2) | ✅ 刘杰 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
clinglai0517, thanks for your pull request. All authors of the commits have signed the CLA. 👍


9月18日 将zengjuan,u010470851,sxb154714,chenfeng61,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,chenqi317,LinPX,wang-xing001,liubo75,tangweiwei2,wangzitao_leo,xubinglin,chenxingyu18,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,liuyang_806设为评审人
9月18日 将zengjuan,u010470851,sxb154714,chenfeng61,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,chenqi317,LinPX,wang-xing001,liubo75,tangweiwei2,wangzitao_leo,xubinglin,chenxingyu18,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,liuyang_806设为评审人
此处折叠了64条消息 查看更多
CANN-robot
9月20日 评论:
9月20日 评论:
The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: 唐超


9月20日 添加了label:lgtmapproved
9月20日 关闭了关联的issue
9月20日 合入了pull request
描述
GE 序列化 ONNX 算子属性为 JSON 时,会省略值为 0 的标量字段(float 的
"f"、int 的"i")。部分插件用attr.contains("f"/"i")判断属性是否存在,或直接访问attr["f"/"i"],导致属性传 0 时被错误回退到算子默认值,或直接抛异常使转换失败。修复方式:先按
name判断属性是否存在,值字段缺失时按该类型的 protobuf 默认值 0 处理,而不是回退默认值或抛异常。涉及算子:
关联的Issue
Issue #6004
测试
bash build.sh --onnxplugin -j16通过(7 个修复源文件全部编译通过)。bash build.sh -u --ophost --ops=elu,leaky_relu,hardmax,ada_cast,14 个用例全部 PASSED(含各算子新增的「零值字段缺失」用例)。alpha=0负半轴输出[0,0,0,0],alpha=3.0回归无影响。文档更新
不涉及
类型标签
AI/Agent生成声明