aclmdlGetOutputDims

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Obtains the dimension information of an output tensor based on the model description.

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

In the dynamic-shape scenario, this API is used to obtain the shape of the maximum batch/image size profile.

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

Index of the output whose dimensions to obtain, indexed from 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, the system converts the tensor name into the format of "acl_modelId_${id}_output_${index}_${random string}" in the output dims.name. If the name of the converted tensor conflicts with that of an existing tensor in the model, the converted tensor name is suffixed with another random string, formatted as _${random string}. 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. For details, see aclError.