产品 |
是否支持 |
|---|---|
Ascend 950PR/Ascend 950DT |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
根据输入的offset偏移返回新的GlobalTensor。
1 | __aicore__ inline GlobalTensor operator[](const uint64_t offset) const |
参数名 |
输入/输出 |
描述 |
|---|---|---|
offset |
输入 |
偏移offset个元素。 |
指定偏移量的GlobalTensor。
无。
1 2 3 4 5 | // operator[]使用方法, aGlobal[4]为从起始地址开始偏移量为4的新tensor auto gmA = aGlobal[4]; // 示例结果如下: // 输入数据(aGlobal): [1 2 3 4 5 6 ... 100] // 输出数据(gmA ): [5 6 7 8 ... 100] |