EsSetFormat
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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
Sets the memory format of a tensor. If no format is set, the default value ND is used.
Prototype
1 | uint32_t EsSetFormat(EsCTensorHolder *tensor, C_Format format) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
tensor |
Input |
Pointer to the tensor holder. |
format |
Input |
Format type. |
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
uint32_t |
0: success; non-zero value: failure |
Constraints
None
Examples
1 2 3 4 5 | / 1. Create a graph builder (EsCGraphBuilder). EsCGraphBuilder *builder = EsCreateGraphBuilder("graph_name"); // 2. Add a start node. EsCTensorHolder *data0 = EsCreateInput(builder, 0); // Add input node 0. The default format is ND. EsSetFormat(data0, C_FORMAT_NCHW); // Set the data format of input node 0 to NCHW. |
Parent topic: C/C++ APIs