---
title: GetViewFormat
description: "获取aclTensor的ViewFormat。ViewFormat为aclTensor的逻辑Format。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1078.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1078.html
indexId: 60d7ce07320f0d34a3113cf4bed2c68a27b1c883879ead5507eaa262ac58e3bd70
---
# GetViewFormat

#### 功能说明

获取aclTensor的ViewFormat。ViewFormat为aclTensor的逻辑Format。


#### 函数原型

```
op::Format GetViewFormat()
```


#### 参数说明

无


#### 返回值说明

返回一个op::Format（即ge::Format），本身是一个枚举，包含多种不同的Format，例如NCHW、ND等。

ge::Format介绍参见《基础数据结构和接口(https://www.hiascend.com/document/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00001.html)》中“ge::Format(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00515.html)”。


#### 约束说明

无


#### 调用示例

```
void Func(const aclTensor *input) {
    auto format = input->GetViewFormat();
}
```
