class_docstr: Tests :class:`~texar.tf.modules.GPT2Classifier` class.
      
docstr: Tests the functionality of automatically collecting trainable
  variables.
code: def test_trainable_variables(self):
      """Tests the functionality of automatically collecting trainable
      variables.
      """
      inputs = tf.placeholder(dtype=tf.int32, shape=[None, None])
  
      # case 1
      hparams = {
          "pretrained_model_name": None,
      }
      clas = GPT2Classifier(hparams=hparams)
      _, _ = clas(inputs)
      self.assertEqual(len(clas.trainable_variables), 198)
  
      # case 2
      hparams = {
          "pretrained_model_name": None,
          "clas_strategy": "all_time",
          "max_seq_length": 8,
      }
      clas = GPT2Classifier(hparams=hparams)
      _, _ = clas(inputs)
      self.assertEqual(len(clas.trainable_variables), 198)
  
      # case 3
      hparams = {
          "pretrained_model_name": None,
          "clas_strategy": "time_wise",
      }
      clas = GPT2Classifier(hparams=hparams)
      _, _ = clas(inputs)
      self.assertEqual(len(clas.trainable_variables), 198)
  
file_path: texar/tests/modules/classifiers/gpt2_classifier_test.py
imports: import numpy
  import tensorflow
  from texar.tf.modules.classifiers.gpt2_classifier import GPT2Classifier
  from texar.tf.utils.test import pretrained_test
label_desc: Use image node_id 2 for calling the GPT2ClassifierTest obj's underlying member method code with example usage: obj.test_trainable_variables() without return types