docstr: Testing time_major param.
  
  
  testing if transposing and setting time_major=False will result in the same
  loss
docstr_tok: ["Testing","time_major","param",".","testing","if","transposing","and","setting","time_major=False","will","result","in","the","same","loss"]
code: def test_time_major(self):
      """Testing time_major param.
  
  
      testing if transposing and setting time_major=False will result in the same
      loss
      """
      # [max_time x batch_size x depth tensor]
      inputs = np.random.randn(2, 2, 3).astype(np.float32)
      labels = SimpleSparseTensorFrom([[0, 1], [1, 0]])
      seq_lens = np.array([2, 2], dtype=np.int32)
  
      inputs_t = constant_op.constant(inputs)
  
      # Transposing tensor to [batch_size x max_time x depth tensor]
      inputs_t_transposed = constant_op.constant(
          inputs.transpose(1, 0, 2)
      )
  
      with self.session(use_gpu=False) as sess:
          loss = _ctc_loss_v2(
              inputs=inputs_t, labels=labels, sequence_length=seq_lens
          )
          loss_transposed = _ctc_loss_v2(
              inputs=inputs_t_transposed,
              labels=labels,
              sequence_length=seq_lens,
              time_major=False,
          )
  
          (tf_loss, tf_loss_transposed) = self.evaluate(
              [loss, loss_transposed]
          )
          self.assertAllEqual(tf_loss, tf_loss_transposed)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import ctc_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the CTCLossTest obj's underlying member method code with example usage: obj.test_time_major() without return types