class_docstr: Base class for text classification.
code: def get_pre_train_graph(self, inputs):
      pretrained_model_meta = self.pretrained_model_path + ".meta"
      seg_idx = self.pretrained_model_seg
      pad_idx = self.pretrained_model_pad
      with tf.name_scope("pretrain_graph") as scope:
          pretrained_graph = tf.get_default_graph()
          if self.pretrained_model_name == "elmo":
              pretrained_saver = tf.train.import_meta_graph(
                  pretrained_model_meta, input_map={"input_x:0": inputs}
              )
              input_x_pretrained = pretrained_graph.get_tensor_by_name(
                  scope + "input_x_elmo:0"
              )
          if self.pretrained_model_name == "bert":
              pad_mask = get_pad_mask_from_token_idx(inputs, pad_idx)
              segment_mask = get_seg_mask_from_token_idx(
                  inputs, seg_idx
              )
              pretrained_saver = tf.train.import_meta_graph(
                  pretrained_model_meta,
                  input_map={
                      "input_ids:0": inputs,
                      "input_mask:0": pad_mask,
                      "segment_ids:0": segment_mask,
                  },
              )
              if self.pretrained_model_output == "seq":
                  input_x_pretrained = (
                      pretrained_graph.get_tensor_by_name(
                          scope
                          + "encoder_layers_{}:0".format(
                              self.pretrained_model_layers
                          )
                      )
                  )
              else:
                  input_x_pretrained = (
                      pretrained_graph.get_tensor_by_name(
                          scope + "input_x_bert_cls:0"
                      )
                  )
          return input_x_pretrained
  
file_path: delta/delta/models/text_cls_model.py
imports: import delta.compat
  from delta.models.base_model import Model
  from delta.layers.utils import get_pad_mask_from_token_idx
  from delta.layers.utils import get_seg_mask_from_token_idx
label_desc: Use image node_id 2 for calling the TextClassModel obj's underlying member method code with example usage: obj.get_pre_train_graph(inputs) and returns: input_x_pretrained