---
title: GetOriginShape
description: "获取Tensor的原始shape。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00208.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00208.html
indexId: 7aa28dca97e95585e0d70932e8d70aa0519c8c5a949fce2477cd6ee1395bd04278
---
# GetOriginShape

#### 函数功能

获取Tensor的原始shape。


#### 函数原型

const Shape &GetOriginShape() const


#### 参数说明

无。


#### 返回值说明

只读的原始shape引用。

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


#### 约束说明

无。


#### 调用示例

```
StorageShape sh({1, 2, 3}, {2, 1, 3});
Tensor t = {sh, {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}}, kOnHost, ge::DT_FLOAT, nullptr};
auto shape = t.GetOriginShape(); // 1,2,3
```
