GraphBuilder Constructor

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

Function Usage

Initializes a GraphBuilder.

Lifecycle description:

  • All TensorHolder objects created by the builder maintain a reference to it.
  • As long as any of its tensors are still being referenced, the builder will not be garbage-collected.
  • After build_and_reset() is called, the builder enters the built state and cannot be used to create new tensors.
  • A new GraphBuilder needs to be created to build another graph.

Prototype

1
GraphBuilder(name: Optional[str] = None)

Parameters

Parameter

Input/Output

Description

name

Input

Graph name, which is of the string type. If the value is None, the default value graph is used.

Returns

None

Restrictions

  • If name is not a string or is set to None, TypeError is thrown.
  • If the graph builder fails to be created, RuntimeError is thrown.