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

#### 产品支持情况

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


#### 函数功能

设置指定index的output的tensor。


#### 函数原型

```
set_output(self, index, output: Union[FlowMsg, np.ndarray, fw.FlowMsg], balance_config: BalanceConfig = None) -> int
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| index | 输入 | 指定输出的index。 |
| output | 输入 | 指定输出的Msg。 |
| balance\_config | 输入 | 可选。输出均衡分发相关配置。 |


#### 返回值

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


#### 异常处理

无


#### 约束说明

无
