aclgrphConvertToWeightRefreshableGraphs

Description

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

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

Prototype

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.

struct WeightRefreshableGraphs {
  ge::Graph infer_graph;
  ge::Graph var_init_graph;
  ge::Graph var_update_graph;
};

Returns

Parameter

Type

Description

-

graphStatus

GRAPH_SUCCESS: success.

Other values: failure.

Example

For details about the call example, see Example.