---
title: SetOriginalShape
description: "设置aclTensor的OriginShape。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1071.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1071.html
indexId: 8ee47437763a3c9c964c6d42f50b17ed9234d0bbbef1d38d992c2029a11018e870
---
# SetOriginalShape

#### 功能说明

设置aclTensor的OriginShape。

OriginShape表示aclTensor在经历transdata节点前（如果存在该节点）的原始shape信息，即tensor的shape数学描述。


#### 函数原型

```
void SetOriginalShape(const op::Shape &shape)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| shape | 输入 | 数据类型为op::Shape（即gert::Shape），记录了一组shape信息，例如一个三维shape：[10, 20, 30]。 说明： gert::Shape介绍参见《基础数据结构和接口(https://www.hiascend.com/document/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00001.html)》中“gert::Shape(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00149.html)”。 |


#### 返回值说明

无


#### 约束说明

无


#### 调用示例

```
// 将input的OriginShape设置为[1, 2, 3, 4, 5]
void Func(aclTensor *input) {
    gert::Shape newShape;
    for (int64_t i = 1; i <= 5; i++) {
        newShape.AppendDim(i);
    }
    input->SetOriginalShape(newShape);
}
```
