API Reference Manual 1.51.0
Loading...
Searching...
No Matches
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.
 
uint32_t dim [ODP_ML_MAX_DIMS]
 Dimension sizes.
 
uint32_t dim_min [ODP_ML_MAX_DIMS]
 Minimum dimension sizes.
 
uint32_t dim_max [ODP_ML_MAX_DIMS]
 Maximum dimension sizes.
 
char dim_name [ODP_ML_MAX_DIMS][ODP_ML_SHAPE_NAME_LEN]
 Dimension name.
 

Detailed Description

Model input / output data shape information.

Examples
odp_ml_perf.c, and odp_ml_run.c.

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

Field Documentation

◆ type

odp_ml_shape_type_t odp_ml_shape_info_t::type

Shape type.

Examples
odp_ml_perf.c, and odp_ml_run.c.

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

◆ 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.

Examples
odp_ml_perf.c, and odp_ml_run.c.

Definition at line 475 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
uint32_t num_dim
Number of dimensions.
uint32_t dim[ODP_ML_MAX_DIMS]
Dimension sizes.

... 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;
#define ODP_ML_DIM_DYNAMIC
Dimension size is dynamic.
Examples
odp_ml_perf.c, and odp_ml_run.c.

Definition at line 505 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.

Examples
odp_ml_perf.c, and odp_ml_run.c.

Definition at line 513 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.

Examples
odp_ml_perf.c, and odp_ml_run.c.

Definition at line 521 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 532 of file api/spec/ml_types.h.


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