code: def network_restore_weights_from_backup(
      self: Union[
          torch.nn.Conv2d,
          torch.nn.Linear,
          torch.nn.GroupNorm,
          torch.nn.LayerNorm,
          torch.nn.MultiheadAttention,
      ]
  ):
      weights_backup = getattr(self, "network_weights_backup", None)
      bias_backup = getattr(self, "network_bias_backup", None)
  
      if weights_backup is None and bias_backup is None:
          return
  
      if weights_backup is not None:
          if isinstance(self, torch.nn.MultiheadAttention):
              self.in_proj_weight.copy_(weights_backup[0])
              self.out_proj.weight.copy_(weights_backup[1])
          else:
              self.weight.copy_(weights_backup)
  
      if bias_backup is not None:
          if isinstance(self, torch.nn.MultiheadAttention):
              self.out_proj.bias.copy_(bias_backup)
          else:
              self.bias.copy_(bias_backup)
      else:
          if isinstance(self, torch.nn.MultiheadAttention):
              self.out_proj.bias = None
          else:
              self.bias = None
  
imports: import logging
  import os
  import re
  import lora_patches
  import network
  import network_lora
  import network_glora
  import network_hada
  import network_ia3
  import network_lokr
  import network_full
  import network_norm
  import network_oft
  import torch
  from typing import Union
  from modules import shared, devices, sd_models, errors, scripts, sd_hijack
  import modules.textual_inversion.textual_inversion
  from lora_logger import logger
label_desc: Use image node_id 6 for calling a global function with example usage: network_restore_weights_from_backup() without return types