CreateVariable

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

Header File/Library File

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

Function Usage

Creates a variable node.

Prototype

1
EsTensorHolder CreateVariable(int32_t index, const char *name)

Parameters

Parameter

Input/Output

Description

index

Input

Variable node index.

name

Input

Variable node name. If the name of var is the same, the variable node is shared. In this case, names of variable nodes must be specified explicitly.

Returns

Parameter

Type

Description

-

EsTensorHolder

Created variable tensor holder. If the creation fails, an invalid EsTensorHolder is returned.

Restrictions

None

Example

1
2
EsGraphBuilder builder("test_graph");
auto v1 = builder.CreateVariable(0, "var0");