Implementing kernel
C++ engine symbols that back this Python API.An nn.Linear with a GraLoRA update: .
Parameters
base_ layernn.LinearThe layer to adapt; the other parameters are those of
GraloraLayer.adapter_ namestrName of the grid made at once.
configGraloraConfigr, hybrid_r, alpha, gralora_dropout, gralora_k and init_weights.Examples
>>> import lucid
>>> import lucid.nn as nn
>>> from lucid.peft import GraloraConfig
>>> from lucid.peft.tuners.gralora import Linear
>>> base = nn.Linear(8, 4)
>>> layer = Linear(base, "default", GraloraConfig(r=4, gralora_k=2, target_modules=["x"]))
>>> tuple(layer.gralora_A["default"].shape), tuple(layer.gralora_B["default"].shape)
((2, 4, 4), (2, 4, 2))
>>> x = lucid.randn(3, 8)
>>> bool((layer(x) == base(x)).all().item()) # B starts at zero
True