GetLength

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 AI Core

Atlas inference product Vector Core

Atlas training product

Function Usage

Obtains the data length of the LocalTensor.

Prototype

1
__aicore__ inline uint32_t GetLength() const

Parameters

None

Returns

Data length of the LocalTensor, in bytes.

Restrictions

None

Examples

1
2
3
4
// Obtain the length (in bytes) of localTensor. The data type is int32_t. Therefore, the length is 16 × sizeof(int32_t).
uint32_t len = inputLocal.GetLength();
// inputLocal:0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// len: 64