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: Instantiate this module from a HuggingFace config. Subclasses should override
  this method if you want to be able to instantiate them with `from_pretrained_module()`.
docstr_tok: ["Instantiate","this","module","from","a","HuggingFace","config",".","Subclasses","should","override","this","method","if","you","want","to","be","able","to","instantiate","them","with","`","from_pretrained_module","(",")","`","."]
code: def _from_config(
      cls: Type[_T], config: "PretrainedConfig", **kwargs
  ) -> _T:
      """
      Instantiate this module from a HuggingFace config. Subclasses should override
      this method if you want to be able to instantiate them with `from_pretrained_module()`.
      """
      raise NotImplementedError
  
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 5 for calling the TransformerModule obj's underlying member method code with example usage: obj._from_config(cls, config) without return types