# MindSpore报错AttributeError: module 'mindspore.ops' has no attribute 'mm'

**1. 系统环境**

硬件环境\(Ascend/GPU/CPU\): Ascend/GPU/CPU

软件环境: MindSpore 版本: 1.10.0

执行模式（静态图/动态图）： 不限

Python 版本: 3.7.6

操作系统平台: linux

**2. 报错信息**

2.1 报错信息

```
Traceback (most recent call last): 
  File "C:\Users\emcon\anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3437, in run_code 
    exec(code_obj, self.user_global_ns, self.user_ns) 
  File "<ipython-input-43-eb21821cfaa2>", line 1, in <module> 
    mm = ops.mm() 
AttributeError: module 'mindspore.ops' has no attribute 'mm'
```

2.2 脚本信息

```
import mindspore as ms
import mindspore.ops as ops
import numpy as np

x1 = ms.Tensor(np.random.rand(2,3))
x2 = ms.Tensor(np.random.rand(3,4))
out = ops.mm(x1,x2)
print(out.shape)
```

**3. 根因分析**

从结果上看1.10版本是没有ops.mm的。

**4. 解决方案**

既然没有mm就用ops.matmul来代替。

```
import mindspore as ms
import mindspore.ops as ops
import numpy as np

x1 = ms.Tensor(np.random.rand(2,3))
x2 = ms.Tensor(np.random.rand(3,4))
out = ops.matmul(x1,x2)
print(out.shape)
```

