code: def rename_orig_weights(state_dict):
      new_state_dict = {}
      for k, v in state_dict.items():
          if k.endswith("kernel"):
              # up- and downsample layers, don't have trainable weights
              continue
  
          new_k = rename(k)
  
          # check if we need to transform from Conv => Linear for attention
          if isinstance(new_k, list):
              new_state_dict = transform_conv_attns(
                  new_state_dict, new_k, v
              )
          else:
              new_state_dict[new_k] = v
  
      return new_state_dict
  
imports: import argparse
  import math
  import os
  from copy import deepcopy
  import torch
  from audio_diffusion.models import DiffusionAttnUnet1D
  from diffusion import sampling
  from torch import nn
  from diffusers import DanceDiffusionPipeline, IPNDMScheduler, UNet1DModel
label_desc: Use image node_id 7 for calling a global function with example usage: rename_orig_weights(state_dict) and returns: new_state_dict