# MindSpore报错：The supported input and output data types for the current operator are: node is Default/BitwiseAnd

**1. 系统环境**

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

软件环境: MindSpore 版本: 2.3.0

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

Python 版本: 3.8.5

操作系统平台: linux

**2. 报错信息**

2.1 报错信息

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/miniconda3/envs/ms/lib/python3.8/site-packages/mindspore/common/_stub_tensor.py", line 48, in fun
    arg = (stub.stub_sync(),) + arg[1:]
  File "/home/user/miniconda3/envs/ms/lib/python3.8/site-packages/mindspore/common/_stub_tensor.py", line 159, in stub_sync
    val = self.stub.get_value()
TypeError: The supported input and output data types for the current operator are: node is Default/BitwiseAnd-op0
InputDesc [0] support {int16,int32,int64,int8,uint16,uint32,uint64,uint8,}
InputDesc [1] support {int16,int32,int64,int8,uint16,uint32,uint64,uint8,}
OutputDesc [0] support {int16,int32,int64,int8,uint16,uint32,uint64,uint8,}

But current operator's input and output data types is:
InputDesc [0] is Bool
InputDesc [1] is Bool
OutputDesc [0] is Bool
```

2.2 脚本信息

```
mask = (label_inds == gti) & (pos_mask > 0)
```

**3. 根因分析**

根据报错信息可以知道，BitwiseAnd算子不支持bool数据类型，因此

首先确认BitwiseAnd是哪个运算符输入的，通过将代码拆分，再次执行可以看到是 & 符号引入的

```
x = (label_inds == gti)
y = (pos_mask > 0)
mask = x & y
```

接下来确认数据类型：打印x和y的类型，可以看到x和y是bool类型的Tensor

**4. 解决方案**

基于上面已知的原因，很容易做出如下修改：

```
import mindspore as ms
x = (label_inds == gti).to(ms.int32)
y = (pos_mask > 0).to(ms.int32)
mask = (x & y).to(ms.bool_)
```

再次执行，模型可以顺利跑通。

