aclGetTensorDescDimRange

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

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

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 element 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

0 on success; else, failure. For details, see aclError.