docstr: :param wrapped:
      The Linear module to be wrapped.
  :param config:
      The LoRA config.
  :param skip_init:
      If ``True``, the weights and bias will be left uninitialized, and
      :meth:`reset_lora_parameters` will become noop.
code: def __init__(
      self,
      wrapped: Projection,
      config: LoRAConfig,
      skip_init: bool = False,
      device: Optional[Device] = None,
      dtype: Optional[DataType] = None,
  ) -> None:
      """
      :param wrapped:
          The Linear module to be wrapped.
      :param config:
          The LoRA config.
      :param skip_init:
          If ``True``, the weights and bias will be left uninitialized, and
          :meth:`reset_lora_parameters` will become noop.
      """
      Projection.__init__(self, wrapped.input_dim, wrapped.output_dim)
      LoRALayer.__init__(self, config)
  
      self.wrapped = wrapped
  
      self.wrapped.weight.requires_grad_(False)
  
      self.weight = self.wrapped.weight  # type: ignore[assignment]
  
      if self.wrapped.bias is not None:
          self.wrapped.bias.requires_grad_(False)
          self.bias = self.wrapped.bias  # type: ignore[assignment]
      else:
          self.register_parameter("bias", None)
  
      self.lora_A = Parameter(
          torch.empty(
              (self.r, self.input_dim), device=device, dtype=dtype
          )
      )
  
      self.lora_B = Parameter(
          torch.empty(
              (self.output_dim, self.r), device=device, dtype=dtype
          )
      )
  
      if self.dropout_p > 0.0:
          self.dropout = Dropout(self.dropout_p)
      else:
          self.register_module("dropout", None)
  
      self.merged = False
  
      self.skip_init = skip_init
  
      self.reset_lora_parameters()
  
imports: import math
  import re
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Any, Dict, List, Literal, Optional, final
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import Dropout
  from torch.nn.functional import embedding, linear
  from torch.nn.parameter import Parameter
  from fairseq2.nn import Embedding, Projection
  from fairseq2.typing import DataType, Device
label_desc: Use image node_id 1 to create a new LoRALinear object from inherited base classes: Projection, LoRALayer with example: obj = LoRALinear(wrapped, config, skip_init, device, dtype)