API Reference Manual  1.45.0
odp_ml_shape_info_t Struct Reference

Model input / output data shape information. More...

#include <ml_types.h>

Data Fields

odp_ml_shape_type_t type
 Shape type.
 
uint32_t num_dim
 Number of dimensions. More...
 
uint32_t dim [ODP_ML_MAX_DIMS]
 Dimension sizes. More...
 
uint32_t dim_min [ODP_ML_MAX_DIMS]
 Minimum dimension sizes. More...
 
uint32_t dim_max [ODP_ML_MAX_DIMS]
 Maximum dimension sizes. More...
 
char dim_name [ODP_ML_MAX_DIMS][ODP_ML_SHAPE_NAME_LEN]
 Dimension name. More...
 

Detailed Description

Model input / output data shape information.

Definition at line 448 of file api/spec/ml_types.h.

Field Documentation

◆ num_dim

uint32_t odp_ml_shape_info_t::num_dim

Number of dimensions.

Number of input / output data dimensions. When zero, the model does not have dimension information available. ODP API supports in maximum ODP_ML_MAX_DIMS dimensions.

Definition at line 458 of file api/spec/ml_types.h.

◆ dim

uint32_t odp_ml_shape_info_t::dim[ODP_ML_MAX_DIMS]

Dimension sizes.

Number of data values in each ('num_dim') dimension. Type of the data is defined by odp_ml_data_type_t enumeration. Depending on the shape type, some dimensions may have dynamic size which is denoted with ODP_ML_DIM_DYNAMIC value. When shape type is ODP_ML_SHAPE_BATCH, the shape has one dynamic dimension which is used as the batch size.

For example, a static (ODP_ML_SHAPE_STATIC) NCHW tensor could be presented as:

num_dim = 4;
dim[0]  = 1;    // no batching, N = 1
dim[1]  = 3;    // 3 color channels
dim[2]  = 720;  // height 720 pixels
dim[3]  = 1280; // width 1280 pixels

... and with dynamic batch size (ODP_ML_SHAPE_BATCH):

num_dim = 4;
dim[0]  = ODP_ML_DIM_DYNAMIC; // dynamic in range: dim_min[0] ... dim_max[0]
dim[1]  = 3;
dim[2]  = 720;
dim[3]  = 1280;

Definition at line 484 of file api/spec/ml_types.h.

◆ dim_min

uint32_t odp_ml_shape_info_t::dim_min[ODP_ML_MAX_DIMS]

Minimum dimension sizes.

Defines the minimum value for each dynamic size (ODP_ML_DIM_DYNAMIC) in dim[] array. Zero is used when the minimum value is unknown. When dimension size is static, the value is equal to dim[] array value.

Definition at line 492 of file api/spec/ml_types.h.

◆ dim_max

uint32_t odp_ml_shape_info_t::dim_max[ODP_ML_MAX_DIMS]

Maximum dimension sizes.

Defines the maximum value for each dynamic size (ODP_ML_DIM_DYNAMIC) in dim[] array. Zero is used when the maximum value is unknown. When dimension size is static, the value is equal to dim[] array value.

Definition at line 500 of file api/spec/ml_types.h.

◆ dim_name

char odp_ml_shape_info_t::dim_name[ODP_ML_MAX_DIMS][ODP_ML_SHAPE_NAME_LEN]

Dimension name.

Name of each ('num_dim') dimension as a null terminated string. Null string is used if a dimension does not have a name. Maximum string length is ODP_ML_SHAPE_NAME_LEN including the null character.

For example, an NCHW tensor could have dimensions named as: dim_name = {"N", "C", "H", "W"}

Definition at line 511 of file api/spec/ml_types.h.


The documentation for this struct was generated from the following file: