Description: Perform single-channel rotary position encoding computation.
Formula:
- [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]:
(1) Half mode (mode equals 0):
(2) Interleave mode (mode equals 1):
(3) Quarter mode (mode equals 2):
(4) interleave-half mode (mode equals 3), this mode first extracts the odd-positioned inputs to the first half and the even-positioned inputs to the second half, then performs the half processing:
Each operator has calls. You must first call [object Object] to obtain the input parameters and calculate the required workspace size according to the process, and then call [object Object] to perform the computation.
Parameters:
[object Object]- Parameter mode constraints:
- [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: 0=half, 1=interleave.
- Parameter mode constraints:
Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- Deterministic Computation:
[object Object]defaults to deterministic implementation.[object Object]Atlas A3 training products/Atlas A3 inference products[object Object], [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]:
The input tensor
[object Object]supports BNSD, BSND, SBND, and TND layouts. The D-dimensional sizes of the input tensor[object Object],[object Object],[object Object], and output tensor[object Object]must be the same, satisfy D < 896, and must be a multiple of 2. The shapes of the input tensor[object Object]and the output tensor[object Object]must be exactly the same. The shapes of the input tensors[object Object]and[object Object]must be exactly the same.- Half mode:
- B, N < 1000.
- When
[object Object]is BNSD,[object Object]and[object Object]support 11SD, B1SD, and BNSD.- When (D/2) % (32/inputDtypeSize) == 0, it must satisfy B N <= S 8.
- When (D/2) % (32/inputDtypeSize) != 0, it must satisfy B N 2 <= (S + coreNum -1) / coreNum or D >= 80.
- When
[object Object]is BSND,[object Object]and[object Object]support 1S1D, BS1D, BSND. - When
[object Object]is SBND,[object Object]and[object Object]support S11D, SB1D, SBND. - When
[object Object]is TND,[object Object]and[object Object]support T1D and TND.
- Interleave mode:
- B * N < 1000 (N<1000 when x is TND)
- When
[object Object]is BNSD,[object Object]and[object Object]support 11SD. - When
[object Object]is BSND,[object Object]and[object Object]support 1S1D. - When
[object Object]is SBND,[object Object]and[object Object]support S11D. - When
[object Object]is TND,[object Object]and[object Object]support T1D.
- Half mode:
The following example is for reference only. For details, see .