GetSize

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 number of elements in the GlobalTensor.

Prototype

1
__aicore__ inline uint64_t GetSize() const

Parameters

None

Returns

Number of elements in the GlobalTensor.

Restrictions

If the SetGlobalBuffer API that transfers only the global data pointer is used to initialize the GlobalTensor, the number of elements obtained through this API is 0.

Examples

AscendC::LocalTensor<uint8_t> stackBuffer;
AscendC::PopStackBuffer<uint8_t, AscendC::TPosition::LCM>(stackBuffer);
uint32_t stackBufferSize = stackBuffer.GetSize();