aclGetTensorDescDimRange

Description

Obtains the range of a tensor dimension in the tensor description. Note that [1, –1] indicates that the dimension size has no limit.

Restrictions

If the aclGetTensorDescNumDims call returns ACL_UNKNOWN_RANK, it indicates that the dimension count is unknown. In this case, aclGetTensorDescDimRange does not output the size range of the specified dimension.

Prototype

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

Sequence number of the dimension whose size to obtain, indexed starting at 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 and second elements in the array indicates the minimum and maximum dimension sizes, respectively. Only the first two elements in the array are valid.

[1, –1] indicates that the dimension size has no limit.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.