CreateVariable

Applicability

Product

Supported or Not

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

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. Therefore, 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.

Constraints

None

Examples

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