ConstructFromInputs

Description

Constructs a graph object based on a user-constructed operator object, the same as the function of SetInputs API.

SetInputs will be deprecated in future releases. Use this API instead.

Prototype

static GraphPtr ConstructFromInputs(const std::vector<Operator> &inputs, const AscendString &name);

Parameters

Parameter

Input/Output

Description

inputs

Input

Operator inputs of the entire graph.

name

Input

Graph name.

Returns

Parameter

Type

Description

-

GraphPtr

Graph pointer, which returns the newly constructed graph.

Example

1
2
3
GraphPtr graph;
graph =  Graph::ConstructFromInputs(inputs, graph_name);
graph->SetOutputs(outputs);