---
title: AddControlEdge
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0496.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0496.html
indexId: 9aa4d09ebe6007bd754861dbb5a2cde1cb71c57d3c6992df41a3c6fb9bea41e972
---
# AddControlEdge

#### 产品支持情况

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


#### 头文件/库文件

- 头文件：#include <ge/es_tensor_holder.h>
- 库文件：libeager_style_graph_builder_base.so、libeager_style_graph_builder_base_static.a


#### 功能说明

控制边连接函数。


#### 函数原型

```
Status AddControlEdge(const std::vector<EsTensorHolder> &ctrl_ins) const
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| ctrl\_ins | 输入 | 控制边输入，支持多个。 |


#### 返回值说明

| 参数名 | 类型 | 说明 |
| --- | --- | --- |
| \- | Status | GRAPH\_SUCCESS(0)：成功 其他值：失败 |


#### 约束说明

无


#### 调用示例

```
auto builder = std::make_unique<ge::EsGraphBuilder>("graph");
  auto tensor0 = builder->CreateInput(0);
  auto tensor1 = builder->CreateInput(1);
  auto tensor2 = builder->CreateInput(2);
  std::vector<EsTensorHolder> ctrl_ins = {tensor1, tensor2};
  （void）tensor0.AddControlEdge(ctrl_ins); // tensor0的生产节点使用tensor1和tensor2的生产节点作为控制输入
```
