add_graph

Function Usage

Adds a graph to a session.

Prototype

1
add_graph(graph_id: int, add_graph: Graph, options: dict = None) -> None

Parameters

Parameter

Input/Output

Description

graph_id

Input

Graph ID.

add_graph

Input

Graph object to be added.

options

Input

Configuration options. For details about the supported configuration items, see the parameters of the graph level in Options.

Returns

None

Restrictions

  • If graph_id is not an integer, TypeError is thrown.
  • If add_graph is not of the graph type, TypeError is thrown.
  • If the options value is not of the dictionary type, TypeError is thrown.
  • If the addition fails, RuntimeError is thrown.
  • If graphs of the same object are registered by calling this API, all graph IDs point to one graph object, causing disorder.
  • Do not use the same graph ID to add different graph objects. In this case, only the graph object added at the first time is retained, and the subsequent graph objects fail to be added.