aclmdlGetOutputDims

Description

Obtains the shape of an output tensor based on the model description. This API is synchronous.

In the static-shape scenario, this API is used to obtain the shape of the output tensor of a model.

This API is used to obtain the maximum shape profile in the dynamic batch/image size scenario.

Prototype

aclError aclmdlGetOutputDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims)

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 whose dims information to obtain, indexed starting at 0.

dims

Output

Pointer to the output shape.

If the length of the original tensor name is less than or equal to 127, the original tensor name is retained in the output dims.name. If the length of the original tensor name is greater than 127, AscendCL converts the tensor name into the format "acl_modelId_${id}_output_${index}_${random string}" in the output dims.name. The _${random string} suffix is added only if the name of the converted tensor already exists in the model. In addition, a mapping between the converted tensor name and the original tensor name is created, which allows you to obtain the original name by passing the converted name to the aclmdlGetTensorRealName call. (If the original name is passed to the API call, the original name is returned.)

Returns

0 on success; else, failure.