EsCreateGraphInput

Applicable Products

All processors

Header File/Library File

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

Function Usage

Creates a data input on a graph.

Prototype

1
EsCTensorHolder *EsCreateGraphInput(EsCGraphBuilder *graph, int64_t index)

Parameters

Parameter

Input/Output

Description

graph

Input

Pointer to the graph builder.

index

Input

Index of the input graph, starting from 0. The node is named input_{index}.

Returns

Parameter

Type

Description

-

EsCTensorHolder *

Pointer to the created tensor holder on success; nullptr on failure.

Restrictions

None

Example

1
2
3
4
5
6
7
8
// 1. Create a graph builder (EsCGraphBuilder).
EsCGraphBuilder *builder = EsCreateGraphBuilder("graph_name");
// Create the first input node (the index starts from 0).
EsCTensorHolder *input0 = EsCreateGraphInput(builder, 0);
// Create the second input node.
EsCTensorHolder *input1 = EsCreateGraphInput(builder, 1);
// Release the graph builder after use.
EsDestroyGraphBuilder(builder);