已合并
fix(pad_v2): golden bfloat16 分支 cv 转为 float 避免类型错误 #3625
yefeicoding创建于 6月29日
fix(pad_v2): golden bfloat16 分支 cv 转为 float 避免类型错误 #3625
已合并
yefeicoding创建于 6月29日
yefeicoding
yefeicoding成员
6月29日

描述

关联的Issue

https://gitcode.com/cann/ops-math/issues/1961

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yefeicoding 的贡献)
yefeicodingyefeicoding成员
6月29日 创建了 pull request,commit f620e52d
CANN-robotCANN-robot成员
6月29日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
6月29日 评论:

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


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
conversion/transpose 宋恺, zhanw_coding (2/2) 宋恺, zhanw_coding (2/1)
repo-cann/ops-math zhanw_coding, 宋恺 (2/2) 宋恺, zhanw_coding (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
atomgit-bot
atomgit-bot
6月29日 评论:

变更摘要

此 PR 修复了 pad_v2_golden 函数在 bfloat16 分支中的类型错误:当输入数据类型为 bfloat16 时,constant_values_arr[0] 返回的是 numpy 标量,后续传给 PyTorch 的 pad 操作可能因类型不匹配导致错误。修改将其显式转换为 Python float,与 x 被转为 torch.float32 的行为保持一致。

主要改动

  • conversion/pad_v2/tests/assets/golden.py: 在 pad_v2_golden 函数的 bfloat16 分支中,将 cv = constant_values_arr[0] 改为 cv = float(constant_values_arr[0]),确保 cv 为 Python 原生浮点数,避免后续 PyTorch 操作的类型错误。
likedislike
atomgit-bot
atomgit-bot
6月29日 评论:

代码审查

✅ 未发现问题

likedislike
yefeicodingyefeicoding成员
6月30日 update merge request[project id: 7649531, iid: 3625, commit_id: 04c17fbfaf22ad63673555b97af1a6fa9a0ea8a8] virtual merging success
此处折叠了23条事件消息 查看更多
yefeicodingyefeicoding成员
6月30日 update merge request[project id: 7649531, iid: 3625, commit_id: 9f8ee9cde4e15cfc9710a8803407dcc07c0ba727] virtual merging success
yefeicoding
yefeicoding成员
6月30日 评论:

/compile

likedislike
yefeicodingyefeicoding成员
6月30日 update merge request[project id: 7649531, iid: 3625, commit_id: d29c4d8a55623fb11262dcbd1d8c565f0df4809d] virtual merging success
CANN-robotCANN-robot成员
6月30日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6月30日 评论:

流水线任务触发成功
任务链接 [b1a0651a5ec544cb960b091b7161dcd6][流水线指导]

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer-chs-math ✅ SUCCESS >>>>>
Compile_kirin-harmony-infer-chs-math-1 ✅ SUCCESS >>>>>
UT_Test ✅ SUCCESS
UT_Test_experimental ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-06-30 17:37:02]    CI执行结束

likedislike
yefeicodingyefeicoding成员
6月30日 修改了pull request 的描述
CANN-robot
CANN-robot成员
6月30日 评论:

流水线任务触发成功
任务链接 [194e68b876574b9c935b02aeddb04c8e][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ⚠️ WARNING >>>>>
codecheck_precommit ⚠️ WARNING >>>>> >>>>>

[2026-06-30 17:30:37]    CI执行结束

likedislike
songkai111成员
6月30日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
6月30日 添加了label:approved
CANN-robotCANN-robot成员
6月30日 添加了label:api-check-pass
CANN-robotCANN-robot成员
6月30日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6月30日 添加了label:ci-pipeline-passed
zhanw_coding
zhanw_coding成员
6月30日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
6月30日 添加了label:lgtm
CANN-robotCANN-robot成员
6月30日 合入了pull request