Function: get_cur_output_dims
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Function Usage
Obtains the runtime shape of an output tensor 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)
Parameters
|
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. |
Returns
|
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 shape of the output tensor of a specified model.
- If you have not called acl.mdl.set_dynamic_batch_size, acl.mdl.set_dynamic_hw_size, or acl.mdl.set_input_dynamic_dims, you can call this API to obtain the shape of the maximum batch/image size profile.
- Static-shape: This API is used to obtain the shape of the output tensors of a model.