---
title: GetDataType
description: "获取Tensor的DataType。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00463.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00463.html
indexId: 775c9555219351955526a257f2e7f9bdcedeccf110ad60d56eb4a9859b6cdc8f78
---
# GetDataType

#### 函数功能

获取Tensor的DataType。


#### 函数原型

```
ge::DataType GetDataType() const
```


#### 参数说明

无。


#### 返回值

ge::DataType类型，返回Tensor的DataType值，默认值为DT_UNDEFINED。


#### 异常处理

无。


#### 约束说明

无。
