CreateVariable
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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"); |
Parent topic: EsGraphBuilder