Compute the LoRA low-rank update of a layer's output: B(Ax), where A has shape (r, d_in), B has shape (d_out, r) and x is an input vector (or a matrix with one input per column). Return only the update, not the base layer output.
Implement solve(x, A, B).
Returns. Return a NumPy array of shape (d_out,) for a vector input.
Example 1
Input:
solve([1.0, 2.0, 3.0], [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]], [[1.0, 1.0], [2.0, 0.0]])
Output:
[3.0, 2.0]
Example 2
Input:
solve([1.0, 1.0], [[0.0, 0.0]], [[5.0], [6.0]])
Output:
[0.0, 0.0]
No results yet
Run your code to check it against the examples, or submit to run every test.