code: def set_recursively(hf_pointer, key, value, full_name, weight_type):
      for attribute in key.split("."):
          hf_pointer = getattr(hf_pointer, attribute)
  
      if weight_type is not None:
          hf_shape = getattr(hf_pointer, weight_type).shape
      else:
          hf_shape = hf_pointer.shape
  
      assert hf_shape == value.shape, (
          f"Shape of hf {key + '.' + weight_type if weight_type is not None else ''} is {hf_shape}, but should be"
          f" {value.shape} for {full_name}"
      )
  
      if weight_type == "weight":
          hf_pointer.weight.data = value
      elif weight_type == "weight_g":
          hf_pointer.weight_g.data = value
      elif weight_type == "weight_v":
          hf_pointer.weight_v.data = value
      elif weight_type == "bias":
          hf_pointer.bias.data = value
      else:
          hf_pointer.data = value
  
      logger.info(
          f"{key + '.' + weight_type if weight_type is not None else ''} was initialized from {full_name}."
      )
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/sew_d/convert_sew_d_original_pytorch_checkpoint_to_pytorch.py
imports: import argparse
  import json
  import os
  import fairseq
  import torch
  from fairseq.data import Dictionary
  from sew_asapp import tasks
  from transformers import SEWDConfig, SEWDForCTC, SEWDModel, Wav2Vec2CTCTokenizer, Wav2Vec2FeatureExtractor, Wav2Vec2Processor, logging
label_desc: Use image node_id 1 for calling a global function with example usage: set_recursively(hf_pointer, key, value, full_name, weight_type) without return types