class_docstr: Base class to help with generalized loading of pretrained weights.
  
  Subclasses should override `_from_config()` if you want to instantiate them with
  `from_pretrained_module()`.
class_docstr_tok: ["Base","class","to","help","with","generalized","loading","of","pretrained","weights",".","Subclasses","should","override","`","_from_config","(",")","`","if","you","want","to","instantiate","them","with","`","from_pretrained_module","(",")","`","."]
docstr: Recursively map keys in a HuggingFace `state_dict` to the corresponding keys
  for this module and all submodules.
docstr_tok: ["Recursively","map","keys","in","a","HuggingFace","`","state_dict","`","to","the","corresponding","keys","for","this","module","and","all","submodules","."]
code: def _get_mapped_state_dict(
      self,
      state_dict: StateDictType,
      mapping: Optional[Dict[str, str]] = None,
  ) -> StateDictType:
      """
      Recursively map keys in a HuggingFace `state_dict` to the corresponding keys
      for this module and all submodules.
      """
      return _get_mapped_state_dict(self, state_dict, mapping=mapping)
  
imports: import logging
  import os
  from os import PathLike
  from typing import TYPE_CHECKING, Optional, Dict, Union, List, Any, TypeVar, Type
  import re
  import warnings
  import torch
  import torch.distributed
  from allennlp.common.util import is_distributed, is_global_primary
  from allennlp.nn.parallel import ShardedModuleMixin
  from allennlp.nn.module import Module
  from allennlp.nn.util import StateDictType, read_state_dict, _check_incompatible_keys
label_desc: Use image node_id 2 for calling the TransformerModule obj's underlying member method code with example usage: obj._get_mapped_state_dict(state_dict, mapping) and returns: _get_mapped_state_dict