!18629 stop mutmul to mul on GPU

Merge pull request !18629 from lingyunli63/stop_matmul_to_mul_GPU
This commit is contained in:
i-robot 2021-06-22 02:06:06 +00:00 committed by Gitee
commit 04f42b9901
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class MatMul(Expander):
def _optimize_to_mul(self):
"""check if matmul can be replace by mul"""
if self.left_format != DF.DEFAULT or self.right_format != DF.DEFAULT:
if self.processor != 'aicore' or self.left_format != DF.DEFAULT or self.right_format != DF.DEFAULT:
return False
k_a = self.shape_a[-2] if self.transpose_a else self.shape_a[-1]
k_b = self.shape_b[-1] if self.transpose_b else self.shape_b[-2]