aclmdlGetOutputDims
Description
Obtains the shape of an output tensor based on the model description.
Static-shape: This API is used to obtain the shape of the output tensors 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 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.