code: def __init__(self, base_layer: nn.Module, **kwargs) -> None:
      self.base_layer = base_layer
      self.r = {}
      self.lora_alpha = {}
      self.scaling = {}
      self.lora_dropout = nn.ModuleDict({})
      self.lora_A = nn.ModuleDict({})
      self.lora_B = nn.ModuleDict({})
      # For Embedding layer
      self.lora_embedding_A = nn.ParameterDict({})
      self.lora_embedding_B = nn.ParameterDict({})
      # Mark the weight as unmerged
      self._disable_adapters = False
      self.merged_adapters = []
      self.kwargs = kwargs
  
      base_layer = self.get_base_layer()
      if isinstance(base_layer, nn.Linear):
          in_features, out_features = (
              base_layer.in_features,
              base_layer.out_features,
          )
      elif isinstance(base_layer, nn.Conv2d):
          in_features, out_features = (
              base_layer.in_channels,
              base_layer.out_channels,
          )
      elif isinstance(base_layer, nn.Embedding):
          in_features, out_features = (
              base_layer.num_embeddings,
              base_layer.embedding_dim,
          )
      elif isinstance(base_layer, Conv1D):
          in_features, out_features = (
              base_layer.weight.ds_shape
              if hasattr(base_layer.weight, "ds_shape")
              else base_layer.weight.shape
          )
      elif hasattr(base_layer, "infeatures") and hasattr(
          base_layer, "outfeatures"
      ):
          # QuantLinear
          in_features, out_features = (
              base_layer.infeatures,
              base_layer.outfeatures,
          )
      elif hasattr(base_layer, "input_size") and hasattr(
          base_layer, "output_size"
      ):
          # Megatron ColumnParallelLinear,RowParallelLinear
          in_features, out_features = (
              base_layer.input_size,
              base_layer.output_size,
          )
      else:
          raise ValueError(f"Unsupported layer type {type(base_layer)}")
  
      self.in_features = in_features
      self.out_features = out_features
  
imports: import math
  import warnings
  from typing import Any, List, Optional, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers.pytorch_utils import Conv1D
  from peft.tuners.tuners_utils import BaseTunerLayer
  from peft.utils.other import transpose
  from .config import LoraConfig
label_desc: Use image node_id 1 to create a new LoraLayer object from inherited base classes: BaseTunerLayer with example: obj = LoraLayer(base_layer)