EsCreateEsCTensorFromFile

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

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 an EsCTensor by a C user using a binary file.

Prototype

1
EsCTensor *EsCreateEsCTensorFromFile(const char *data_file_path, const int64_t *dim, int64_t dim_num,C_DataType data_type, C_Format format)

Parameters

Parameter

Input/Output

Description

data_file_path

Input

Path of the tensor binary data file.

dim

Input

Pointer to the tensor dimension array.

dim_num

Input

Number of tensor dimensions.

data_type

Input

Enumerated value of DataType of a tensor.

format

Input

Tensor format.

Returns

Parameter

Type

Description

-

EsCTensor *

Anonymous pointer to the tensor. If the operation fails, nullptr is returned.

Constraints

None

Examples

1
2
3
int64_t dims[] = {3};
auto es_tensor =
    EsCreateEsCTensorFromFile(file_path.c_str(), dims, 1, C_DT_INT64, C_FORMAT_ALL);