Function: get_dynamic_batch

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

Prototype

  • C Prototype
    1
    aclError aclmdlGetDynamicBatch(const aclmdlDesc *modelDesc, aclmdlBatch *batch)
    
  • Python Function
    1
    batch, ret = acl.mdl.get_dynamic_batch(model_desc)
    

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.

Return Value Description

Return Value

Description

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.