---
title: IsBasicType
description: "判断输入的数据类型，是否为基础类型。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1095.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1095.html
indexId: 127edb9cc74ded9d02941f2ebf8f72276dda91828631a95a87261a9aa3b97a2470
---
# IsBasicType

#### 功能说明

判断输入的数据类型，是否为基础类型。


#### 函数原型

```
bool IsBasicType(const DataType dtype)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| dtype | 输入 | 输入数据类型，判断该类型是否为基础数据类型。 基础类型包括：Complex128、Complex64、Float64、Float32、Float16、Int16、Int32、Int64、Int8、QInt16、QInt32、QInt8、QUInt16、QUInt8、UInt16、UInt32、UInt64、UInt8、BFloat16。 |


#### 返回值说明

输入数据类型为基础类型时，返回true，否则返回false。


#### 约束说明

无


#### 调用示例

```
// 判断dtype不为基础类型时，返回
void Func(const DataType dtype) {
    if (!IsBasicType(dtype)) {
        return;
    }
}
```
