code: def get_delta_weight(self, adapter_name: str) -> torch.Tensor:
      # https://github.com/KohakuBlueleaf/LyCORIS/blob/eb460098187f752a5d66406d3affade6f0a07ece/lycoris/modules/loha.py#L178
      if adapter_name in self.hada_t1.keys():
          weight = make_weight_cp(
              self.hada_t1[adapter_name],
              self.hada_w1_a[adapter_name],
              self.hada_w1_b[adapter_name],
              self.hada_t2[adapter_name],
              self.hada_w2_a[adapter_name],
              self.hada_w2_b[adapter_name],
              scale=torch.tensor(self.scaling[adapter_name]),
          )
      else:
          weight = make_weight(
              self.hada_w1_a[adapter_name],
              self.hada_w1_b[adapter_name],
              self.hada_w2_a[adapter_name],
              self.hada_w2_b[adapter_name],
              scale=torch.tensor(self.scaling[adapter_name]),
          )
  
      base_layer = self.get_base_layer()
      weight = weight.reshape(base_layer.weight.shape)
  
      # Perform rank dropout during training - drop rows of addition weights
      rank_dropout = self.rank_dropout[adapter_name]
      if self.training and rank_dropout:
          drop = (torch.rand(weight.size(0)) > rank_dropout).to(
              weight.dtype
          )
          drop = drop.view(-1, *[1] * len(weight.shape[1:])).to(
              weight.device
          )
          # TODO: Investigate if there should be a scaler like in normal dropout during training
          # Original implementation doesn't have it
          # https://github.com/KohakuBlueleaf/LyCORIS/blob/eb460098187f752a5d66406d3affade6f0a07ece/lycoris/modules/loha.py#L193
          drop /= drop.mean()
          weight *= drop
  
      return weight
  
imports: import math
  from typing import Any, Set, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from peft.tuners.lycoris_utils import LycorisLayer
label_desc: Use image node_id 7 for calling the LoHaLayer obj's underlying member method code with example usage: obj.get_delta_weight(adapter_name) and returns: weight