---
title: SetShape
description: "设置TensorBase的形状。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0432.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0432.html
indexId: 5c3fae4c9b5b38ca116aaec5bc56033451dcb08fd03fe0ae7923af860448d0ee102
---
# SetShape

#### 函数功能

设置TensorBase的形状。


#### 函数原型

```
APP_ERROR SetShape(std::vector<uint32_t> shape);
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| shape | 输入 | shape向量中各维度要求为正整数且单个或各项乘积需小于536,870,912（512 \* 1024 \* 1024），否则函数将抛出异常。 |


#### 返回参数说明

| 数据结构 | 说明 |
| --- | --- |
| APP\_ERROR | 程序执行返回的错误码，请参考APP\_ERROR说明。 |
