Function: get_tensor_desc_dim_range
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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.
Prototype
- C Prototype
1aclError aclGetTensorDescDimRange(const aclTensorDesc *desc, size_t index, size_t dimRangeNum, int64_t *dimRange)
- Python Function
1dim_range, ret = acl.get_tensor_desc_dim_range(desc, index, dim_range_num)
Parameter Description
Parameter |
Description |
|---|---|
desc |
Int, pointer address of the aclTensorDesc type. Call acl.create_tensor_desc to create data of the aclTensorDesc type in advance. |
index |
Int, sequence number of the dimension whose size is to be obtained, starting from 0. Value range: [0, Dimension count – 1]. Call acl.get_tensor_desc_num_dims to obtain the dimension count. |
dim_range_num |
Int, dim_range length. The value must be greater than or equal to 2. |
Return Value Description
Return Value |
Description |
|---|---|
dim_range |
List, size range of the dimension specified by index in the tensor description.
|
ret |
Int, error code.
|
Restrictions
If the return value of acl.get_tensor_desc_num_dims is ACL_UNKNOWN_RANK(0xFFFFFFFFFFFFFFFE), the dimension count is unknown. In this case, calling acl.get_tensor_desc_dim_range cannot obtain the range of the specified dimension.