!49571 [bugfix] Fix I6IGS5

Merge pull request !49571 from shaojunsong/fix/I6IGS5
This commit is contained in:
i-robot 2023-03-02 02:00:17 +00:00 committed by Gitee
commit d674dcc043
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 0 deletions

View File

@ -5244,6 +5244,10 @@ def addmm(x, mat1, mat2, *, beta=1, alpha=1):
[115. 137. 159.]
[187. 225. 263.]]
"""
if not isinstance(alpha, (int, float)):
raise TypeError(f"For 'addmm', parameter 'alpha' must be an int or float, but got {type(alpha)}.")
if not isinstance(beta, (int, float)):
raise TypeError(f"For 'addmm', parameter 'beta' must be an int or float, but got {type(beta)}.")
matmul_op = _get_cache_prim(P.MatMul)()
return beta * x + alpha * (matmul_op(mat1, mat2))