[Pass] Support transpose_Y in matmul_elt_add_fuse_pass #7162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
【问题】
当
matmul
中的transpose_Y
参数为true
时,无法通过 matmul_elt_add_fuse_pass 融合为FC
,也无法通过 matmul_fuse_pass 将matmul
转换为mul
。比如如下模型结构中,
matmul
中的transpose_Y
参数为true
,经 opt 图优化前后结构一样,无法转为FC
进行计算。【本PR工作】
在 matmul_elt_add_fuse_pass 中实现支持这一 case:
transpose_Y
为true
且Y
为persistable()
如上提到的子结构经该 pass 后,可以转为
FC
:【效果】
使用 cls_blur_model_fp32 模型验证,arm cpu/opencl 精度保持不变。