aclgrphConvertToWeightRefreshableGraphs

Applicability

Product

Supported or Not

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Header File/Library File

  • Header file: #include <ge/ge_ir_build.h>
  • Library file: libge_compiler.so

Function Usage

Converts the original graph into a group of graphs whose weights can be updated by passing the const node name array.

Applies to the weight update scenario. For details, see Special Topics > Weight Update.

Prototype

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

Parameters

Parameter

Input/Output

Description

origin_graph

Input

Original graph whose weight needs to be updated.

const_names

Input

Name array of the nodes whose weights need to be updated.

weight_refreshable_graphs

Output

Graphs whose weights can be updated. This parameter is a structure and consists of three parts: weight initialization graph, weight update graph, and inference graph.

1
2
3
4
5
struct WeightRefreshableGraphs {
  ge::Graph infer_graph;
  ge::Graph var_init_graph;
  ge::Graph var_update_graph;
};

Returns

Parameter

Type

Description

-

graphStatus

GRAPH_SUCCESS(0): success.

Other values: failure. For details, see ge::graphStatus.

Example

For details about the call example, see Example.