SetOutputs

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

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.

Restrictions

This API must be called in the final step of the graph construction process. Deleting Outputs or Targets nodes after this call may cause errors.