class_docstr: A class providing helper methods for saving and loading module weights.
class_docstr_tok: ["A","class","providing","helper","methods","for","saving","and","loading","module","weights","."]
code: def _load_module_state_dict(module, state_dict, start_prefix=""):
      missing_keys = []
      unexpected_keys = []
      error_msgs = []
  
      # copy state_dict so _load_from_state_dict can modify it
      metadata = getattr(state_dict, "_metadata", None)
      state_dict = state_dict.copy()
      if metadata is not None:
          state_dict._metadata = metadata
  
      def load(module, prefix=""):
          local_metadata = (
              {} if metadata is None else metadata.get(prefix[:-1], {})
          )
          module._load_from_state_dict(
              state_dict,
              prefix,
              local_metadata,
              True,
              missing_keys,
              unexpected_keys,
              error_msgs,
          )
          for name, child in module._modules.items():
              if child is not None:
                  load(child, prefix + name + ".")
  
      load(module, prefix=start_prefix)
  
      if len(error_msgs) > 0:
          raise RuntimeError(
              "Error(s) in loading state_dict for {}:\n\t{}".format(
                  module.__class__.__name__, "\n\t".join(error_msgs)
              )
          )
      return missing_keys, unexpected_keys
  
imports: import json
  import logging
  from abc import ABC, abstractmethod
  from os import mkdir
  from os.path import exists, isdir, isfile, join
  from typing import Callable, Mapping, Sequence, Tuple
  import torch
  from .configuration import AdapterConfig, build_full_config
  from .head_utils import STATIC_TO_FLEX_HEAD_MAP, get_head_config_and_rename_list
  from .utils import ACTIVATION_RENAME, ADAPTERFUSION_CONFIG_NAME, ADAPTERFUSION_WEIGHTS_NAME, CONFIG_NAME, HEAD_CONFIG_NAME, HEAD_WEIGHTS_NAME, WEIGHTS_NAME, AdapterType, resolve_adapter_path
label_desc: Use image node_id 7 for calling the WeightsLoaderHelper obj's underlying member method code with example usage: obj._load_module_state_dict(module, state_dict, start_prefix) and returns: missing_keys,  unexpected_keys