class_docstr: A mixin class to support loading pre-trained checkpoints for modules
  that implement the BERT model.
  
  The BERT model was proposed in (`Devlin et al`. 2018)
  `BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding`_
  . A bidirectional Transformer language model pre-trained on large text
  corpora. Available model names include:
  
    * ``bert-base-uncased``: 12-layer, 768-hidden, 12-heads,
      110M parameters.
    * ``bert-large-uncased``: 24-layer, 1024-hidden, 16-heads,
      340M parameters.
    * ``bert-base-cased``: 12-layer, 768-hidden, 12-heads , 110M parameters.
    * ``bert-large-cased``: 24-layer, 1024-hidden, 16-heads,
      340M parameters.
    * ``bert-base-multilingual-uncased``: 102 languages, 12-layer,
      768-hidden, 12-heads, 110M parameters.
    * ``bert-base-multilingual-cased``: 104 languages, 12-layer, 768-hidden,
      12-heads, 110M parameters.
    * ``bert-base-chinese``: Chinese Simplified and Traditional, 12-layer,
      768-hidden, 12-heads, 110M parameters.
  
  We provide the following BERT classes:
  
    * :class:`~texar.tf.modules.BERTEncoder` for text encoding.
    * :class:`~texar.tf.modules.BERTClassifier` for text classification and
      sequence tagging.
  
  .. _`BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding`:
      https://arxiv.org/abs/1810.04805
class_docstr_tok: ["A","mixin","class","to","support","loading","pre-trained","checkpoints","for","modules","that","implement","the","BERT","model",".","The","BERT","model","was","proposed","in","(","`","Devlin","et","al","`",".","2018",")","`","BERT",":","Pre-training","of","Deep","Bidirectional","Transformers","for","Language","Understanding","`","_",".","A","bidirectional","Transformer","language","model","pre-trained","on","large","text","corpora",".","Available","model","names","include",":","*","``","bert-base-uncased","``",":","12-layer",",","768-hidden",",","12-heads",",","110M","parameters",".","*","``","bert-large-uncased","``",":","24-layer",",","1024-hidden",",","16-heads",",","340M","parameters",".","*","``","bert-base-cased","``",":","12-layer",",","768-hidden",",","12-heads",",","110M","parameters",".","*","``","bert-large-cased","``",":","24-layer",",","1024-hidden",",","16-heads",",","340M","parameters",".","*","``","bert-base-multilingual-uncased","``",":","102","languages",",","12-layer",",","768-hidden",",","12-heads",",","110M","parameters",".","*","``","bert-base-multilingual-cased","``",":","104","languages",",","12-layer",",","768-hidden",",","12-heads",",","110M","parameters",".","*","``","bert-base-chinese","``",":","Chinese","Simplified","and","Traditional",",","12-layer",",","768-hidden",",","12-heads",",","110M","parameters",".","We","provide","the","following","BERT","classes",":","*",":","class",":","`","~texar.tf.modules.BERTEncoder","`","for","text","encoding",".","*",":","class",":","`","~texar.tf.modules.BERTClassifier","`","for","text","classification","and","sequence","tagging",".","..","_","`","BERT",":","Pre-training","of","Deep","Bidirectional","Transformers","for","Language","Understanding","`",":","https",":","\/\/arxiv.org\/abs\/1810.04805"]
code: def _init_from_checkpoint(
      self, pretrained_model_name, cache_dir, scope_name, **kwargs
  ):
      tvars = tf.trainable_variables()
      init_checkpoint = os.path.abspath(
          os.path.join(cache_dir, "bert_model.ckpt")
      )
      if init_checkpoint:
          (
              assignment_map,
              initialized_variable_names,
          ) = self._get_assignment_map_from_checkpoint(
              tvars, init_checkpoint, scope_name
          )
          tf.train.init_from_checkpoint(init_checkpoint, assignment_map)
  
file_path: texar/texar/tf/modules/pretrained/bert.py
imports: import collections
  import json
  import os
  import re
  from abc import ABCMeta
  import tensorflow
  from texar.tf.modules.pretrained.pretrained_base import PretrainedMixin
label_desc: Use image node_id 2 for calling the PretrainedBERTMixin obj's underlying member method code with example usage: obj._init_from_checkpoint(pretrained_model_name, cache_dir, scope_name) without return types