Skip to content
data

TunerLayerStatus

TunerLayerStatus(name: str, module_type: str, enabled: bool, active_adapters: list[str], merged_adapters: list[str], requires_grad: dict[str, GradState], available_adapters: list[str], devices: dict[str, list[str]])

The state of one adapter layer.

Attributes

namestr
The layer's dotted name under the model, e.g. "model.encoder.q_proj".
module_typestr
The layer's class as it prints, e.g. "lora.Linear".
enabledbool
Whether the layer applies adapters (it runs the base alone when not).
active_adapterslist of str
The adapters the forward pass applies.
merged_adapterslist of str
The adapters folded into the base weight.
requires_graddict
Per adapter, whether all its parameters here train (True), none do (False) or some do ("irregular").
available_adapterslist of str
Every adapter the layer holds, sorted.
devicesdict
Per adapter, the device types its parameters are on, sorted.

Used by 2

Class methods

2
cls

all_of

→list[TunerLayerStatus]
all_of(root: nn.Module)

The status of every adapter slot under root, in module order.

Raises

ValueError
root holds no adapter layer.