---
title: acltdtCreateDataItem
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclcppdevg_03_1619.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_1619.html
indexId: 70c313121c5cece11f4546687b92d39a9a911b77aaeb7da8655646a8069c541b68
---
# acltdtCreateDataItem

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 | x |
| Atlas 训练系列产品 | √ |


#### 功能说明

创建acltdtDataItem类型的数据，代表一个业务上的Tensor。

如需销毁acltdtDataItem类型的数据，请参见acltdtDestroyDataItem。


#### 函数原型

```
acltdtDataItem *acltdtCreateDataItem(acltdtTensorType tdtType,
const int64_t *dims,
size_t dimNum,
aclDataType dataType,
void *data,
size_t size)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| tdtType | 输入 | tensor类型。类型定义请参见acltdtTensorType。 |
| dims | 输入 | tensor的Shape。 |
| dimNum | 输入 | tensor的Shape中的维度个数。 |
| dataType | 输入 | 正常数据里的数据类型。类型定义请参见aclDataType。 |
| data | 输入 | 数据地址指针。 |
| size | 输入 | 数据长度。 |


#### 返回值说明

- 返回acltdtDataItem类型的指针，表示成功。
- 返回nullptr，表示失败。
