xnn.common.finetune.lora.register_lora_target#

xnn.common.finetune.lora.register_lora_target(cls, weight='weight', in_axis=1)[source]#

Make instances of cls eligible for inject_lora().

Parameters:
  • cls (type) – A module class with a dense 2-D weight parameter.

  • weight (str, optional) – Name of that parameter, by default "weight".

  • in_axis (int, optional) – Axis of the weight that is the input dimension (1 for torch.nn.Linear’s (d_out, d_in)), by default 1.

Return type:

None