CreateVector

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 vector constant.

Prototype

  • Create a vector constant of the int64 type.
    1
    EsTensorHolder CreateVector(const std::vector<int64_t> &value)
    
  • Create a vector constant of the int32 type.
    1
    EsTensorHolder CreateVector(const std::vector<int32_t> &value)
    
  • Create a vector constant of the uint64 type.
    1
    EsTensorHolder CreateVector(const std::vector<uint64_t> &value)
    
  • Create a vector constant of the uint32 type.
    1
    EsTensorHolder CreateVector(const std::vector<uint32_t> &value)
    
  • Create a vector constant of the float type.
    1
    EsTensorHolder CreateVector(const std::vector<float> &value)
    

Parameters

Parameter

Input/Output

Description

value

Input

Data vector of the vector constant.

Returns

Parameter

Type

Description

-

EsTensorHolder

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

Restrictions

None

Example

1
2
3
EsGraphBuilder builder("test_graph");
std::vector<int64_t> vec64 = {1, 2, 3};
auto v1 = builder.CreateVector(vec64);