---
title: GetExpandDimsType
description: "获取原始Format向运行时Format转换时的补维规则。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00016.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00016.html
indexId: 1adf92d4492bfd380cc2ef67b11e1f8897ceddb83729cc7463461ae34272045978
---
# GetExpandDimsType

#### 函数功能

获取原始Format向运行时Format转换时的补维规则。


#### 函数原型

```
ExpandDimsType GetExpandDimsType() const
```


#### 参数说明

无。


#### 返回值说明

补维规则，请参考ExpandDimsType。


#### 约束说明

无。


#### 调用示例

```
auto dtype_ = ge::DataType::DT_INT32;
StorageFormat fmt_(ge::Format::FORMAT_NC, ge::FORMAT_NCHW, {});
ExpandDimsType type_("1001");
gert::CompileTimeTensorDesc td;
td.SetDataType(dtype_);
auto dtype = td.GetDataType(); // ge::DataType::DT_INT32;
td.SetStorageFormat(fmt_.GetStorageFormat());
auto storage_fmt = td.GetStorageFormat(); // ge::FORMAT_NCHW
td.SetOriginFormat(fmt_.GetOriginFormat());
auto origin_fmt = td.GetOriginFormat(); // ge::Format::FORMAT_NC
td.SetExpandDimsType(type_);
auto type = td.GetExpandDimsType(); // type_("1001")
```
