Obtains the runtime shape of an output tensor based on the model description. This API is synchronous.
Currently, this API can be used to obtain the dimension information of the model output tensors only in the following scenarios:
aclError aclmdlGetCurOutputDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims)
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 from 0. |
dims |
Output |
Pointer to the runtime 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.) |
0 on success; else, failure.