SetOutputs

Applicable Products

All processors

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.