Function: get_input_dynamic_gear_count

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Obtains the number of dynamic dimension profiles supported by a model based on the model description.

Prototype

  • C Prototype
    1
    aclError aclmdlGetInputDynamicGearCount(const aclmdlDesc *modelDesc, size_t index, size_t *gearCount)
    
  • Python Function
    1
    gear_count, ret = acl.mdl.get_input_dynamic_gear_count(model_desc, index)
    

Parameter Description

Parameter

Description

model_desc

Int, pointer address of the aclmdlDesc model description data.

Call acl.mdl.create_desc to create data of the aclmdlDesc type in advance.

index

Int, reserved. The value is fixed to –1.

Return Value Description

Return Value

Description

gear_count

Int, number of dynamic shape profiles.

For example, if the input tensor of a model is 4-dimensional and the dimension size profiles specified by the --dynamic_dims parameter for model conversion are 1, 3, 224, 224; 2, 3, 224, 224; 1, 3, 256, 256, the number of dynamic dimension profiles obtained by this API call is 3.

ret

Int, error code.

Restrictions

If no dynamic dimension profile is not set during model building, this API call returns 0 dynamic dimension profiles. For details about model building, see Model Building.