Build

Applicable Products

All processors

Header File/Library File

  • Header file: #include <ge/compliant_node_builder.h>
  • Library files: libeager_style_graph_builder_base.so and libeager_style_graph_builder_base_static.a

Function Usage

Builds and returns a graph node.

Prototype

1
ge::GNode Build() const

Parameters

None

Returns

Parameter

Type

Description

-

GNode

Object of the built graph node.

Restrictions

None

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
auto ge_graph = std::make_unique<ge::Graph>("graph");
auto add_node = ge::es::CompliantNodeBuilder(ge_graph.get()).OpType("Add")
      .Name("add_0")
      .IrDefInputsV2({
          {"x1", ge::es::CompliantNodeBuilder::kEsIrInputRequired, ""},
          {"x2", ge::es::CompliantNodeBuilder::kEsIrInputRequired, ""},
      })  
      .IrDefOutputsV2({
          {"y", ge::es::CompliantNodeBuilder::kEsIrOutputRequired, ""},
      })  
      .IrDefAttrsV2({
      })  
      .Build();
// In this example, an Add operator instance add_0 is created in the graph based on the Add IR prototype through chain calls.