EsSetOriginSymbolShape
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 symbolic expression of the tensor shape. If it is not set, there is no symbolic information by default.
Prototype
1 | uint32_t EsSetOriginSymbolShape(EsCTensorHolder *tensor, const char *const *shape, int64_t dim_num); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
tensor |
Input |
Pointer to the tensor holder. |
shape |
Input |
Pointer to the symbolic shape string array. |
dim_num |
Input |
Number of symbolic shape strings. |
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
uint32_t |
0: success; non-zero value: failure |
Constraints
None
Examples
1 2 3 4 5 6 7 8 | / 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 value is a [] scalar. const char* input_shape[] = {"a", "b", "c", "d"}; // Compute the number of dimensions (dim_num). int64_t dim_num = sizeof(input_shape) / sizeof(input_shape[0]); // The result is 4. EsSetOriginSymbolShape(data0, input_shape, dim_num); //Set the symbolic shape of input node 0. |
Parent topic: C/C++ APIs