---
title: SetExpandDimsType
description: "设置补维规则。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00169.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00169.html
indexId: 6f93d10705f277c9f6d1d19011b037edc50e1dba2f9b4ede2dbc6718f28c621e78
---
# SetExpandDimsType

#### 函数功能

设置补维规则。


#### 函数原型

```
void SetExpandDimsType(const ExpandDimsType &expand_dims_type)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| expand\_dims\_type | 输入 | 补维规则。 |


#### 返回值说明

无。


#### 约束说明

无。


#### 调用示例

```
ExpandDimsType dim_type("1100");
StorageFormat format(ge::Format::FORMAT_NCHW, ge::Format::FORMAT_C1HWNC0, dim_type);
ExpandDimsType new_dim_type("1010");
format.SetExpandDimsType(new_dim_type);
```
