Function: get_input_dynamic_dims
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Obtains the dynamic dimensions supported by a model based on the model description.
Prototype
- C Prototype
1aclError aclmdlGetInputDynamicDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims, size_t gearCount)
- Python Function
1dims_out, ret = acl.mdl.get_input_dynamic_dims(model_desc, index, gear_count)
Parameter Description
Parameter |
Description |
|---|---|
model_desc |
Int, pointer address of the data of the aclmdlDesc type. Call acl.mdl.create_desc to create data of the aclmdlDesc type in advance. |
index |
Int, reserved. The value is fixed to –1. |
gear_count |
Int, number of dynamic dimension profiles supported by the model, which needs to be obtained through the acl.mdl.get_input_dynamic_gear_count call in advance. |
Return Value Description
Return Value |
Description |
|---|---|
dims_out |
List, an array for the dynamic shape. The dims_out parameter is a list. The number of elements in the list is the same as the number of inputs of the model. Each element in the list is a aclmdlIODims dictionary. dims in the aclmdlIODims dictionary is a list. Each element in the list corresponds to a specific value in each dimension size choice. For example: dims_out, ret = acl.mdl.get_input_dynamic_dims(model_desc, -1, gear_count) |
ret |
Int, error code.
|
Restrictions
This API can be called only after the --dynamic_dims parameter is specified for model conversion.
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 shape returned by this API call is as follows (Note that the name parameter in the aclmdlIODims dictionary is reserved currently):