aclGetTensorDescDimRange
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Obtains the range of a tensor dimension in the tensor description. Note that [1, –1] indicates that the dimension size has no limit.
If the aclGetTensorDescNumDims call returns ACL_UNKNOWN_RANK, it indicates that the dimension count is unknown in the dynamic-shape scenario. In this case, calling aclGetTensorDescDimRange cannot obtain the size range of the specified dimension.
Prototype
1 | aclError aclGetTensorDescDimRange(const aclTensorDesc *desc, size_t index, size_t dimRangeNum, int64_t *dimRange) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
desc |
Input |
Pointer to data of the aclTensorDesc type. Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance. |
index |
Input |
Index of the dimension size to obtain, indexed from 0. Must be in the range of [0, Dimension count – 1]. Call aclGetTensorDescNumDims to obtain the dimension count. |
dimRangeNum |
Input |
Length of dimRange, which must be greater than or equal to 2. |
dimRange |
Output |
Size range of the dimension specified by index in the tensor description. dimRange is an array. The first element indicates the minimum value of the range, and the second element indicates the maximum value of the range. Only the first two elements in the array are valid. [1, –1] indicates that the dimension size has no limit. |
Returns
0 on success; else, failure. For details, see aclError.