---
title: aclGetTensorDescDimV2
description: "获取tensor描述中指定维度的大小。同步接口。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgc/aclcppdevg_03_1780.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgc/aclcppdevg_03_1780.html
indexId: 5105732f759bac6b5d812bba261191b14cbe5f8c8698ced1f2995c96e4b0dfb6105
---
# aclGetTensorDescDimV2

#### 函数功能

获取tensor描述中指定维度的大小。同步接口。


#### 约束说明

当aclGetTensorDescNumDims接口的返回值为ACL_UNKNOWN_RANK时，表示动态Shape场景下维度个数未知，则不能调用aclGetTensorDescDimV2接口获取指定维度的大小。


#### 函数原型

aclError aclGetTensorDescDimV2(const aclTensorDesc *desc, size_t index, int64_t *dimSize)


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| desc | 输入 | aclTensorDesc类型的指针。 需提前调用aclCreateTensorDesc接口创建aclTensorDesc类型。 |
| index | 输入 | 指定获取第几个维度的大小，index值从0开始。 用户调用aclGetTensorDescNumDims接口获取shape维度个数，这个Index的取值范围：[0, (shape维度个数\-1)]。 |
| dimSize | 输出 | tensor描述中index指定维度大小的指针。 当返回的dimSize参数值为\-1时，表示维度的大小是动态的。 |


#### 返回值说明

返回0表示成功，返回其它值表示失败。
