aclmdlGetInputDynamicDims

Applicability

Product

Supported

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

Description

Obtains the dynamic dimensions supported by a model based on the model description.

Prototype

aclError aclmdlGetInputDynamicDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims, size_t gearCount)

Parameters

Parameter

Input/Output

Description

modelDesc

Input

Pointer to data of the aclmdlDesc type.

Call aclmdlCreateDesc to create data of the aclmdlDesc type in advance.

index

Input

Reserved. The value is fixed to -1.

dims

Output

Pointer to the input dynamic dimension information.

The dims parameter is an array. Each element in the array points to the aclmdlIODims struct. The dims parameter defined in the aclmdlIODims struct is also an array. Each element in the array corresponds to a specific value in each dimension size choice.

Example:

aclmdlIODims dims[gearCount];
aclmdlGetInputDynamicDims(model.modelDesc, -1, dims, gearCount);

gearCount

Input

Number of dynamic dimension size profiles supported by the model, which needs to be obtained through the aclmdlGetInputDynamicGearCount call in advance.

Returns

0 on success; else, failure. For details, see aclError.

Restrictions

This API can be called to obtain dynamic dimension profiles only after the dynamic dimension profiles are set at model build time. For details about model building, see Building a Model.

Assume that a model has three inputs: data (1, 1, 40, -1), label (1, -1), and mask (-1, -1), where -1 indicates a dynamic dimension. If dynamic_dims is set to --dynamic_dims="20,20,1,1;40,40,2,2;80,60,4,4" for model conversion, then the dynamic dimension information returned by this API call is as follows (note that the name parameter in the aclmdlIODims struct is reserved currently):

  • Profile 0:
    • In the aclmdlIODims struct, dimCount: 8 indicates that the inputs have eight dimensions altogether.
    • In the aclmdlIODims struct, dims: 1,1,40,20,1,20,1,1 indicates shape profile 0 of each input: data (1, 1, 40, 20), label (1, 20), and mask (1, 1).
  • Profile 1:
    • In the aclmdlIODims struct, dimCount: 8 indicates that the inputs have eight dimensions altogether.
    • In the aclmdlIODims struct, dims: 1,1,40,40,1,40,2,2 indicates shape profile 1 of each input: data (1, 1, 40, 40), label (1, 40), and mask (2, 2).
  • Profile 2:
    • In the aclmdlIODims struct, dimCount: 8 indicates that the inputs have eight dimensions altogether.
    • In the aclmdlIODims struct, dims: 1,1,40,80,1,60,4,4 indicates shape profile 2 of each input: data (1, 1, 40, 80), label (1, 60), and mask (4, 4).