GetSize
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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();
Parent topic: GlobalTensor