class_docstr: Wrapper that always initializes weights from a pre-trained checkpoint.
class_docstr_tok: ["Wrapper","that","always","initializes","weights","from","a","pre-trained","checkpoint","."]
code: def __init__(self, *sublayers, init_checkpoint=None):
      super().__init__(*sublayers)
  
      if init_checkpoint is None:
          # initialize model from scratch
          self.init_checkpoint = None
      elif os.path.sep not in init_checkpoint:
          # initialize model from model name
          (
              init_checkpoint_dir,
              init_checkpoint_filename,
          ) = self.download_model(init_checkpoint)
          self.init_checkpoint = os.path.join(
              init_checkpoint_dir, init_checkpoint_filename
          )
      else:
          # initialize model from path
          self.init_checkpoint = init_checkpoint
  
imports: import os
  import pathlib
  import urllib
  import zipfile
  import gin
  import jax
  import tensorflow
  from trax import fastmath
  from trax import layers
  from trax.fastmath import numpy
label_desc: Use image node_id 1 to create a new PretrainedBERT object from inherited base classes: tl with example: obj = PretrainedBERT()