build_and_reset

Function Usage

Build a graph.

Prototype

1
build_and_reset(outputs: Optional[List[TensorHolder]] = None) -> Graph

Parameters

Parameter

Input/Output

Description

outputs

Input

(Optional) List of tensor holders to be set as the graph output. If provided, all outputs are automatically set before the graph is built. The output index starts from 0 and is allocated in sequence. If the value is None, the previously set output is used to build a graph.

Returns

(Graph) Constructed graph object.

Constraints

  • After build_and_reset () is called, the builder enters the built state and cannot be used to create new tensors.
  • You need to create a GraphBuilder to build another graph.
  • If the output is not a TensorHolder object list, a TypeError is thrown.
  • If the build fails, RuntimeError is thrown.