operator[]

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

Returns a new GlobalTensor based on the input offset.

Prototype

1
__aicore__ inline GlobalTensor operator[](const uint64_t offset) const

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

offset

Input

Number of elements to offset.

Returns

Returns a GlobalTensor with the specified offset.

Restrictions

None

Examples

1
2
3
4
5
// Usage of operator[]. aGlobal[4] is a new tensor with an offset of 4 starting from the start address.
auto gmA = aGlobal[4];
// The result is as follows:
// Input data (aGlobal): [1 2 3 4 5 6 ... 100]
// Output data (gmA): [5 6 7 8 ... 100]