Description:
Multiplies the input
[object Object]by the corresponding[object Object]and[object Object]based on the input index values in[object Object], and accumulates the results into the input[object Object]to produce the output.Formulas:
Given an input tensor
[object Object]with the last dimension length of 2d, the AddLora function performs the following operations:Rearrange
[object Object]based on the index values in[object Object]. Elements of[object Object]corresponding to the same weight group are placed together.Loop through each LoRA group and perform matrix multiplication using its corresponding
[object Object]element and[object Object].Multiply the resultant
[object Object]with[object Object].Finally, accumulate
[object Object]into[object Object]to obtain the output.
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the computation process. Then, [object Object] is called to perform computation.
Parameters:
[object Object]- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: The data formats of [object Object]weightB[object Object] and [object Object]weightAOptional[object Object] can be ND.
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 a deterministic implementation.
The following example is for reference only. For details, see .