Function: get_dynamic_hw

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)

Function Usage

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

Input 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: Reserved. The value is fixed to –1.

Return Value

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 image size profiles supported by the model.
    "hw":[xx, xx,]  # Specific image size profiles supported by the model. In each profile, the element whose index is 0 indicates the height, and the element whose index is 1 indicates the width.
    }
  • If hwCount is 0, dynamic image size is not supported. The image size defined in the model applies.

ret: int, error code.

Restrictions

None