Obtains the dynamic shape profiles supported by a model based on the model description. This API is synchronous.
This API can be called to obtain dynamic shape profiles only after the dynamic shape 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 denotes 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 shape returned by this API call is as follows (note that the name parameter in the aclmdlIODims struct is reserved currently):
aclError aclmdlGetInputDynamicDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims, size_t gearCount)
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. |
gearCount |
Input |
Number of dynamic dimension profiles supported by the model, which needs to be obtained through the aclmdlGetInputDynamicGearCount call in advance. |
dims |
Output |
Pointer to the input dynamic shape. Each element in the array points to the aclmdlIODims struct. The dims parameter defined in the aclmdlIODims struct is also an array, whose elements correspond to the dimension profiles. Example: aclmdlIODims dims[gearCount]; aclmdlGetInputDynamicDims(model.modelDesc, -1, dims, gearCount); |
0 on success; else, failure.