Implementing kernel
C++ engine symbols that back this Python API.An nn.Linear with a GLoRA update: .
Parameters
base_ layernn.LinearThe layer to adapt; the other parameters are those of
GloraLayer.adapter_ namestrName of the first adapter.
configGloraConfigr, config_A_B, config_C, config_D_E and init_weights.Examples
>>> import lucid
>>> import lucid.nn as nn
>>> from lucid.peft import GloraConfig
>>> from lucid.peft.tuners.glora import Linear
>>> base = nn.Linear(8, 4)
>>> layer = Linear(base, "default", GloraConfig(r=2, target_modules=["x"]))
>>> sorted(layer.glora_A["default"].state_dict()), tuple(layer.glora_C["default"].Xu.shape)
(['Xd', 'Xu'], (2, 1))
>>> x = lucid.randn(3, 8)
>>> bool((layer(x) == base(x)).all().item()) # the supports start at zero
True