---
title: GetOriginFormat
description: "获取CompileTimeTensorDesc所描述Tensor的原始数据排布格式。"
url: https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/latest/maintenref/basicdataapi/atlasopapi_07_00014.html
sourcePath: /source/zh/CANNCommunityEdition/920beta1/maintenref/basicdataapi/atlasopapi_07_00014.html
indexId: e7dc73064e20e709aa28d00013b1071056a9a79f04960cfd726b7102cd5e7f7189
---
# GetOriginFormat

#### 函数功能

获取CompileTimeTensorDesc所描述Tensor的原始数据排布格式。


#### 函数原型

```
ge::Format GetOriginFormat() const
```


#### 参数说明

无。


#### 返回值说明

CompileTimeTensorDesc所描述Tensor的原始数据排布格式。


#### 约束说明

无。


#### 调用示例

```
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")
```
