class_docstr: Tests :class:`~texar.tf.modules.XLNetRegressor` 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,
      }
      regressor = XLNetRegressor(hparams=hparams)
      regressor(inputs)
      n_xlnet_vars = 162
      n_projection_vars = 2
      n_logits_vars = 2
      self.assertEqual(
          len(regressor.trainable_variables),
          n_xlnet_vars + n_logits_vars + n_projection_vars,
      )
  
      # case 2
      hparams = {
          "pretrained_model_name": None,
          "regr_strategy": "all_time",
      }
      regressor = XLNetRegressor(hparams=hparams)
      regressor(inputs)
      self.assertEqual(
          len(regressor.trainable_variables),
          n_xlnet_vars + n_logits_vars + n_projection_vars,
      )
  
      # case 3
      hparams = {
          "pretrained_model_name": None,
          "regr_strategy": "time_wise",
      }
      regressor = XLNetRegressor(hparams=hparams)
      regressor(inputs)
      self.assertEqual(
          len(regressor.trainable_variables),
          n_xlnet_vars + n_logits_vars + n_projection_vars,
      )
  
file_path: texar/tests/modules/regressors/xlnet_regressor_test.py
imports: import numpy
  import tensorflow
  from texar.tf.modules.regressors.xlnet_regressor import XLNetRegressor
  from texar.tf.utils.test import pretrained_test
label_desc: Use image node_id 2 for calling the XLNetRegressorTest obj's underlying member method code with example usage: obj.test_trainable_variables() without return types