code: def testGetFinal(self):
      with self.test_session():
          sequences = np.arange(40).reshape((4, 5, 2))
          lengths = np.array([0, 1, 2, 5])
          expected_values = np.array(
              [[0, 1], [10, 11], [22, 23], [38, 39]]
          )
  
          self.assertAllEqual(
              expected_values,
              lstm_utils.get_final(
                  sequences, lengths, time_major=False
              ).eval(),
          )
  
          self.assertAllEqual(
              expected_values,
              lstm_utils.get_final(
                  np.transpose(sequences, [1, 0, 2]),
                  lengths,
                  time_major=True,
              ).eval(),
          )
  
file_path: magenta/magenta/models/music_vae/lstm_utils_test.py
imports: from magenta.models.music_vae import lstm_utils
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the LstmUtilsTest obj's underlying member method code with example usage: obj.testGetFinal() without return types