AddGraphClone

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

x

Atlas inference products

Atlas training products

Header File/Library File

  • Header file: #include <ge/ge_api_v2.h>
  • Library file: libge_runner_v2.so

Function Usage

Adds a graph to a GeSession, in which a unique graph ID is generated.

Unlike AddGraph, if you pass a graph object to this API, a copy of the graph object is generated. The graph saved in the GeSession is a backup of the graph object. Any modification to the graph does not affect the original graph in the GeSession. Similarly, any modification to the graph in the GeSession does not affect the graph object.

Prototype

1
2
Status AddGraphClone(uint32_t graph_id, const Graph &graph)
Status AddGraphClone(uint32_t graph_id, const Graph &graph, const std::map<AscendString, AscendString> &options)

Parameters

Parameter

Input/Output

Description

graph_id

Input

ID of the graph.

graph

Input

Graph to be loaded to the GeSession.

options

Input

A key-value mapping table, for the graph configuration. key indicates the parameter type, and value indicates the parameter value, both of type string.

Generally, this parameter can be left blank, indicating using the same options configuration passed to GEInitializeV2.

If the configuration information of the current graph needs to be configured separately, you can use this parameter. The supported configuration items are the same as those of AddGraph.

Returns

Parameter

Type

Description

-

Status

GE_CLI_GE_NOT_INITIALIZED: GE not initialized.

SUCCESS: Graph added successfully.

FAILED: Failed to add the graph.

Constraints

If graphs of the same object are registered by calling this API, all graph IDs point to different backup copies, and the backup copies corresponding to two different graph IDs are not shared.