code: def print_all_variables(train_only=False):
      """Print information of trainable or all variables,
      without ``tl.layers.initialize_global_variables(sess)``.
  
      Parameters
      ----------
      train_only : boolean
          Whether print trainable variables only.
              - If True, print the trainable variables.
              - If False, print all variables.
  
      """
      # tvar = tf.trainable_variables() if train_only else tf.all_variables()
      if train_only:
          t_vars = tf.compat.v1.trainable_variables()
          logging.info("  [*] printing trainable variables")
  
      else:
          t_vars = tf.compat.v1.global_variables()
          logging.info("  [*] printing global variables")
  
      for idx, v in enumerate(t_vars):
          logging.info(
              "  var {:3}: {:15}   {}".format(
                  idx, str(v.get_shape()), v.name
              )
          )
  
imports: import numpy
  import tensorflow
  from tensorflow.python.ops.rnn_cell import LSTMStateTuple
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated, deprecated_alias
label_desc: Use image node_id 12 for calling a global function with example usage: print_all_variables(train_only) without return types