aclmdlGetOutputSizeByIndex

Description

Obtains the size (in bytes) of an output based on the model description. This API is synchronous.

Restrictions

If the obtained size is 0, a possible cause is that the range of the output shape is uncertain. You need to estimate a large output buffer as needed. During model execution, the system checks whether the specified output buffer size meets the requirement. If no, an error message is returned, with the size of the desired output memory displayed. You can use either of the following methods to view the error message:

Prototype

size_t aclmdlGetOutputSizeByIndex(aclmdlDesc *modelDesc, size_t index)

Parameters

Parameter

Input/Output

Description

modelDesc

Input

Pointer to data of the aclmdlDesc type.

Call aclmdlCreateDesc to create data of the aclmdlDesc type in advance.

index

Input

Sequence number of the output to obtain, indexed starting at 0.

Returns

If dynamic batch/image size is enabled, the output size of the maximum profile is returned. In other cases, the size of the specified output is returned. The unit is byte.