已合并
update: 更新文件 matmul_custom.cpp #534
chenmingyu创建于 8月5日
update: 更新文件 matmul_custom.cpp #534
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 chenmingyu 的贡献)8月5日 创建了 pull request,commit b1ab4c82
atomgit-bot
8月5日 评论:
8月5日 评论:
变更摘要
该 PR 修复了矩阵乘法算子 matmul_custom 中 InferShape 和 InferDataType 的推导逻辑,使其正确反映矩阵乘法(A: [M, K] × B: [K, N] → C: [M, N])的输出形状,并将输出数据类型固定为 FP32。
主要改动
InferShape输出形状推导修正:原先仅将输出形状设为输入 0 的形状,现改为以输入 0 形状为基础,再将输出第二维设为输入 1 的第二维(y_shape->SetDim(1, b_shape->GetDim(1))),正确表达 M×N 的输出形状。InferDataType输出类型固定为 FP32:原先从输入 0 继承数据类型,现改为直接设置context->SetOutputDataType(0, ge::DT_FLOAT),确保输出类型确定。- 变量命名与注释优化:将
x1_shape重命名为a_shape、b_shape,并添加了维度注释(// a: [M, K]、// b: [K, N]、// c: [M, N]),提升代码可读性。


不准确?
atomgit-bot
8月5日 评论:
8月5日 评论:
8月5日 添加了label:cann-cla/yes
CANN-robot
8月5日 评论:
8月5日 评论:
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 |
|---|---|---|
| repo-cann/cann-learning-hub | ✅ waimaidaole, fuyangchenghu (2/2) | ✅ waimaidaole (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


CANN-robot
8月5日 评论:
8月5日 评论:
8月5日 关联了issue:[Course-Feedback|课程反馈]: 04.03 Matmul参考答案InferShape/InferDataType错误(输出误用输入a的shape与dtype)
8月5日 关联了issue:[Course-Feedback|课程反馈]: 04.03 Matmul参考答案InferShape/InferDataType错误(输出误用输入a的shape与dtype)
8月5日 添加了label:approved
fuyangchenghu
8月6日 评论:
8月6日 评论:
/lgtm


8月6日 添加了label:lgtm
8月6日 合入了pull request
描述
关联的Issue
测试
文档更新
类型标签
其他信息