SetOutputs

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

Sets the output operators associated with a graph.

Prototype

APIs taking string arguments will be deprecated in future releases. Use APIs taking non-string arguments instead.

1
2
3
4
Graph &SetOutputs(const std::vector<Operator>& outputs)
Graph &SetOutputs(const std::vector<std::pair<Operator, std::vector<size_t>>> &output_indexs)
Graph &SetOutputs(const std::vector<std::pair<ge::Operator, std::string> > &outputs)
Graph &SetOutputs(const std::vector<std::pair<ge::Operator, AscendString>> &outputs)

Parameters

Parameter

Input/Output

Description

outputs

Input

Output node list. If there are multiple outputs, the results of all outputs are returned in the sequence of the input operator list of this API. Multiple outputs are sorted by port index in ascending order.

output_indexs

Input

Computation results returned based on the specified operator and its output (port index description and size_t type). The sequence is the same as that of the input parameters of this API.

outputs

Input

Computation results returned based on the specified operator and its output (port name description and string type). The sequence is the same as that of the input parameters of this API.

Returns

Parameter

Type

Description

-

Graph&

Caller itself.

Constraints

None