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

#### 产品支持情况

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


#### 头文件/库文件

- 头文件：#include <ge/ge_ir_build.h>
- 库文件：libge_compiler.so


#### 功能说明

通过传入Const节点名数组将原图转换成一组权重可更新的图。

该接口适用于权重更新场景，详细介绍请参见专题>权重更新(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/graphdevg/atlasag_25_0055.html)。


#### 函数原型

```
graphStatus aclgrphConvertToWeightRefreshableGraphs(const ge::Graph &origin_graph, const std::vector<AscendString> &const_names, WeightRefreshableGraphs &weight_refreshable_graphs)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |  |  |
| --- | --- | --- | --- | --- |
| origin\_graph | 输入 | 需要权重更新的原图。 |  |  |
| const\_names | 输入 | 需要权重更新的节点名数组。 |  |  |
| weight\_refreshable\_graphs | 输出 | 权重可更新的图，该参数为一结构体，包括三部分：权重初始化图，权重更新图，推理图。 1 2 3 4 5 struct WeightRefreshableGraphs { ge::Graph infer\_graph; ge::Graph var\_init\_graph; ge::Graph var\_update\_graph; }; | 1 2 3 4 5 | struct WeightRefreshableGraphs { ge::Graph infer\_graph; ge::Graph var\_init\_graph; ge::Graph var\_update\_graph; }; |
| 1 2 3 4 5 | struct WeightRefreshableGraphs { ge::Graph infer\_graph; ge::Graph var\_init\_graph; ge::Graph var\_update\_graph; }; |  |  |  |


#### 返回值说明

| 参数名 | 类型 | 说明 |
| --- | --- | --- |
| \- | graphStatus | GRAPH\_SUCCESS(0)：成功。 其他值：失败，详情请参见"ge::graphStatus(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00513.html)"。 |


#### 调用示例

完整调用示例请参见调用示例。
