SetOutput
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Sets the output node of a graph.
Prototype
1 | static int64_t SetOutput(const EsTensorHolder &tensor, int64_t index); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
tensor |
Input |
Tensor holder. |
index |
Input |
Index, starting from 0. |
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
int64_t |
Operation result. If the operation is successful, 0 is returned. If the operation fails, a non-zero value is returned. |
Constraints
None
Examples
1 2 3 4 5 6 7 8 | //1. Create a graph builder (EsGraphBuilder). EsGraphBuilder builder("graph_name"); // 2. Add two input nodes. EsTensorHolder [data0, data1] = builder.CreateInputs<2>(); // 3. Add an intermediate node. In C++, common operators such as addition, subtraction, multiplication, and division have been overloaded for direct use. EsTensorHolder add = data0 + data1; // 4. Set the graph output. add is the 0th output tensor. builder.SetOutput(add, 0); |
Parent topic: EsGraphBuilder