---
title: reshape
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/others/dataflowdevg/udfrefp_23_0027.html
sourcePath: /source/zh/canncommercial/900/others/dataflowdevg/udfrefp_23_0027.html
indexId: 5583725f5eaaf74398ce8803250bd008145e5830077e5e0e23be2d58534f88ed70
---
# reshape

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 | x |
| Atlas 训练系列产品 | x |


#### 函数功能

对tensor进行Reshape操作，不改变tensor的内容。


#### 函数原型

```
def reshape(self, shape: Union[List[int], Tuple[int]])
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| shape | 输入 | 要改变的目标shape。 要求shape元素个数必须和原来shape的个数一致。 |


#### 返回值

- 0：SUCCESS
- other：FAILED，具体请参考  UDF错误码
。


#### 异常处理

无


#### 约束说明

如果对输入进行reshape动作，可能会影响其他使用本输入的节点正常执行。
