code: def transpose_batch_time(inputs):
      """Transposes inputs between time-major and batch-major.
  
      Args:
          inputs: A Tensor of shape `[batch_size, max_time, ...]` (batch-major)
              or `[max_time, batch_size, ...]` (time-major), or a (possibly
              nested) tuple of such elements.
  
      Returns:
          A (possibly nested tuple of) Tensor with transposed batch and
          time dimensions of inputs.
      """
      flat_input = nest.flatten(inputs)
      flat_input = [
          ops.convert_to_tensor(input_) for input_ in flat_input
      ]
      # pylint: disable=protected-access
      flat_input = [
          rnn._transpose_batch_time(input_) for input_ in flat_input
      ]
      return nest.pack_sequence_as(
          structure=inputs, flat_sequence=flat_input
      )
  
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 1 for calling a global function with example usage: transpose_batch_time(inputs) and returns: nest