AddOp

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 <graph/graph.h>
  • Library file: libgraph.so

Function Usage

Registers an unconnected operator with a graph for query and object obtaining.

Prototype

1
graphStatus AddOp(const ge::Operator &op)

Parameters

Parameter

Input/Output

Description

op

Input

Operator to be added.

Returns

Parameter

Type

Description

-

graphStatus

SUCCESS: Operation succeeded.

FAILED: Operation failed.

Constraints

This API is optional. For a switchover between functions, an operator object may be a local variable and cannot be obtained by functions. In this case, the operator can be registered with the graph to obtain the previously created operator object. After the operator object is registered in the graph, the operator object exists unless the graph is destroyed.