Function: get_dynamic_hw

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: Supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Obtains the dynamic image size information supported by a model based on the model description.

Prototype

  • C Prototype

    aclError aclmdlGetDynamicHW(const aclmdlDesc *modelDesc, size_t index, aclmdlHW *hw)
    
  • Python Function

    hw_info, ret = acl.mdl.get_dynamic_hw(model_desc, index)
    

Parameters

Parameter Description
model_desc Int, pointer address of the data of the aclmdlDesc type. Call the acl.mdl.create_desc API to create data of the aclmdlDesc type in advance.
index Int, reserved. The value is fixed to
1.

Return Values

Return Value Description
hw_info Dict, width and height (image size) supported by the obtained model.
The maximum number of HW is 128. hw_info = { "hwCount": int, # Number of width and height profiles supported by the model. "hw": [xx, xx,] # Specific profiles supported by the model. In each profile group, the array subscript 0 indicates the height, and the array subscript 1 indicates the width.} - If hwCount is 0, the profile information cannot be set and the profile in the model is used.
ret Int, error code.
0: success
Other values: failure