Description: Applies rotary positional encoding (RoPE) to a single input tensor
[object Object].Formulas:
RotateHalf(q) indicates that the elements in the second half of the D dimension of q are moved to the first half and multiplied by –1, and the second half is replaced by the values of the first half.
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
[object Object]
[object Object]
Parameters
[object Object]Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following error codes may be returned.
[object Object]
- Deterministic computation:
[object Object]defaults to a deterministic implementation.
- This API can be used in inference scenarios.
- The x, cos, sin, and out must be 4D tensors with the shape of (B, N, S, D).
- The S dimension of cos and sin can be 1 or the same as that of x. The N dimension must be 1.
- The D dimension of x, cos, and sin must be 64.
The following example is for reference only. For details, see .
[object Object]