code: def _transpose_batch_time(x):
      """Transpose the batch and time dimensions of a Tensor.
  
      Retains as much of the static shape information as possible.
  
      Args:
        x: A tensor of rank 2 or higher.
  
      Returns:
        x transposed along the first two dimensions.
  
      Raises:
        ValueError: if `x` is rank 1 or lower.
      """
      x_static_shape = x.get_shape()
      if x_static_shape.ndims is not None and x_static_shape.ndims < 2:
          invalidInputError(
              False,
              "Expected input tensor %s to have rank at least 2, but saw shape: %s"
              % (x, x_static_shape),
          )
      x_rank = array_ops.rank(x)
      x_t = array_ops.transpose(
          x,
          array_ops.concat(([1, 0], math_ops.range(2, x_rank)), axis=0),
      )
      x_t.set_shape(
          tensor_shape.TensorShape(
              [x_static_shape[1].value, x_static_shape[0].value]
          ).concatenate(x_static_shape[2:])
      )
      return x_t
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import rnn_cell_impl
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.util import nest
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 1 for calling a global function with example usage: _transpose_batch_time(x) and returns: x_t