---
title: GetExpandDimsType
description: "获取形状的补维规则。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00758.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00758.html
indexId: 2c3423208db2c4d4df41e1690d27b876aa1392a1720f019bb916113705337cc978
---
# GetExpandDimsType

#### 函数功能

获取形状的补维规则。


#### 函数原型

```
ExpandDimsType GetExpandDimsType() const
```


#### 参数说明

无


#### 返回值说明

返回形状的补维规则。

关于ExpandDimsType类型的定义，请参见ExpandDimsType。


#### 约束说明

无


#### 调用示例

```
TensorV2 tensor{{{8, 3, 224, 224}, {16, 3, 224, 224}},       // shape              
                {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}},  // format              
                kFollowing,                                  // placement              
                ge::DT_FLOAT16,                              //dt              
                nullptr};
auto expand_dims_type = tensor.GetExpandDimsType();   // ExpandDimsType{}
```
