Function: get_cur_output_dims
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Runtime shape information supported by a model based on the model description.
Prototype
- C Prototype
1aclError aclmdlGetCurOutputDims(const aclmdlDesc *modelDesc, size_t index, aclIODims *dims)
- Python Function
1dims, ret = acl.mdl.get_cur_output_dims(model_desc, index)
Parameter Description
Parameter |
Description |
|---|---|
model_desc |
Int, pointer address of the data of the aclmdlDesc type. Call acl.mdl.create_desc to create data of the aclmdlDesc type in advance. |
index |
Int, index of the output whose dimensions to obtain, indexed from 0. |
Return Value Description
Return Value |
Description |
|---|---|
dims |
Dict, runtime shape.
|
ret |
Int, error code.
|
Restrictions
Currently, this API can be used to obtain the shape of the model output tensors only in the following scenarios:
- Set the batch size, resolution, or dimension value through model conversion to implement dynamic batch, dynamic image size, or dynamic dimension (ND format).
- If you have set batch by calling acl.mdl.set_dynamic_batch_size, set the width and height of the input image by calling acl.mdl.set_dynamic_hw_size, or set the value of a dynamic dimension by calling acl.mdl.set_input_dynamic_dims, you can call this API to obtain the actual dimension information of the output tensor of a specified model.
- If the acl.mdl.set_dynamic_batch_size, acl.mdl.set_dynamic_hw_size, or acl.mdl.set_input_dynamic_dims API is not called, this interface can be used to obtain the dimension information of the maximum dimensions.
- Static-shape: This API is used to obtain the shape of the output tensors of a model.