code: def get_batch_size(tensor):
      """Returns a unit `Tensor` representing the batch size, i.e.,
      the size of the 1st dimension of :attr:`tensor`.
      """
      return tf.shape(tensor)[0]
  
file_path: texar/texar/tf/utils/shapes.py
imports: import numpy
  import tensorflow
  from tensorflow.python.util import nest
  from tensorflow.python.ops import rnn
  from tensorflow.python.framework import ops
label_desc: Use image node_id 2 for calling a global function with example usage: get_batch_size(tensor) and returns: tf