aclGetTensorDescDimV2

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

Obtains the size of a tensor dimension specified in the tensor description.

Prototype

1
aclError aclGetTensorDescDimV2(const aclTensorDesc *desc, size_t index, int64_t *dimSize)

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.

dimSize

Output

Pointer to the size of the dimension specified by index in the tensor description.

If –1 is returned, the dimension size is not determinable until runtime.

Returns

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

Restrictions

If the return value of aclGetTensorDescNumDims is ACL_UNKNOWN_RANK, the dimension count is unknown. In this case, calling aclGetTensorDescDimV2 cannot obtain the size of the specified dimension.