Function: get_dynamic_hw

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 dynamic image size information supported by a model based on the model description.

Prototype

  • C Prototype
    1
    aclError aclmdlGetDynamicHW(const aclmdlDesc *modelDesc, size_t index, aclmdlHW *hw)
    
  • Python Function
    1
    hw_info, ret = acl.mdl.get_dynamic_hw(model_desc, index)
    

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.

Return Value Description

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 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.