---
title: add_control_edge
description: "添加控制边。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0712.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0712.html
indexId: d900005ff15fa442ce5cb6f888e4015bb21edaf629d78d2411b6cbbf4a3b1b3372
---
# add_control_edge

#### 功能说明

添加控制边。


#### 函数原型

```
add_control_edge(src_node: Node, dst_node: Node) -> None
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| src\_node | 输入 | 边的源节点。 |
| dst\_node | 输入 | 边的目标节点。 |


#### 返回值说明

无


#### 约束说明

- 如果参数类型不正确，抛出TypeError。
- 如果添加操作失败，抛出RuntimeError。
