Function: get_dynamic_batch

C Prototype

aclError aclmdlGetDynamicBatch(const aclmdlDesc *modelDesc, aclmdlBatch *batch)

Python Function

batch, ret = acl.mdl.get_dynamic_batch(model_desc)

Function Usage

Obtains the dynamic batch 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.

Return Value

batch: dict, dynamic batch information supported by the obtained model.

  • The maximum number of batches supported by the model is 128.

    batch = {
        "batchCount": int, # Number of batch profiles supported by the model.
        "batch": [xx, xx,]  # Specific batch profiles supported by the model.
    }
  • If batchCount is 0, dynamic batch size is not supported. The batch size defined in the model applies.

ret: int, error code.

Restrictions

None