Function: get_input_size_by_index

C Prototype

size_t aclmdlGetInputSizeByIndex(aclmdlDesc *modelDesc, size_t index)

Python Function

size = acl.mdl.get_input_size_by_index(model_desc, index)

Function Usage

Obtains the input size in bytes based on data of the aclmdlDesc type.

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: int, sequence number of the input to be obtained, starting from 0.

Return Value

size: int, size of the input, in bytes.

  • If dynamic batch/image size (width and height) is enabled, the input size of the maximum profile is returned.
  • In other (static) cases, the size of the specified input is returned. The unit is byte.

Restrictions

If the shape input by the model is dynamic and the value of the dimension is –1 (indicating that any value greater than or equal to 1 can be used for the dimension), the size obtained from this call is 0. You need to allocate the memory based on the size of the memory occupied.