aclmdlGetCurOutputDims
Description
Obtains the runtime shape of an output tensor based on the model description.
Restrictions
Currently, this API can be used to obtain the dimension information of the model output tensors only in the following scenarios:
- Dynamic batch size, dynamic image size, or dynamic dimensions (ND format only) setting through model conversion: If aclmdlSetDynamicBatchSize, aclmdlSetDynamicHWSize, or aclmdlSetInputDynamicDims has been called, this API outputs the runtime shape of the specified output tensor. In other cases, this API outputs the maximum shape profile.
- Static-shape: This API is used to obtain the shape of the output tensors of a model.
Prototype
aclError aclmdlGetCurOutputDims(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 runtime output shape. If the length of the tensor name is greater than 127, the system converts the tensor name to the acl_modelId_ ${id} _output_ ${index} _ ${Random character string} format when outputting dims.name. If the tensor name after conversion conflicts with an existing tensor name in the model, _ ${Random character string} is added to the end of the converted tensor name. Otherwise, no random character string is added. In addition, the system establishes a mapping between the converted name and the original name, you can call the aclmdlGetTensorRealName API to transfer the converted name and obtain the original name (if the original name is transferred to the API, the original name is obtained). If the length of the tensor name is less than or equal to 127, the output dims.name is based on the tensor name. |
Returns
The value 0 indicates success, and other values indicate failure. For details, see aclError.