code: def test_viterbi_in_exp_space_with_start_and_end(self):
      scores = np.array(
          [[10.0, 12.0, 6.0, 4.0], [13.0, 12.0, 11.0, 10.0]]
      )
      x = 0.0
      # pyformat: disable
      # pylint: disable=bad-whitespace
      # pylint: disable=bad-continuation
      transition_params = np.array(
          [
              [0.1, 0.2, 0.3, 0.4, 0.1],
              [0.5, 0.6, 0.7, 0.8, 0.1],
              [0.9, x, 0.15, x, 0.1],
              [0.25, 0.35, 0.45, 0.55, 0.5],
              [0.1, 0.5, 0.1, 0.1, x],
          ]
      )
      # pyformat: enable
      # pylint: enable=bad-whitespace
      # pylint: enable=bad-continuation
  
      # STEP 1:
      #   Starting scores are {.5, 6.0, .6, .4}
      #   Raw scores are: {13.0, 12.0, 11.0, 10.0}
      #
      # Final state 0: (13.0) Weighted scores are {1.3, 6.5, 11.7, 3.25}
      #      New totals are {0.13, 39, 7.02, 1.3} [max 39 from 1]
      #
      # Final state 1: (12.0) Weighted scores are {2.4, 7.2, 0, 4.2},
      #      New totals are {0.24, 43.2, 0, 1.68} [max 43.2 from 1]
      #
      # Final state 2: (11.0) Weighted scores are {3.3, 7.7, 1.65, 4.95},
      #      New totals are {0.33, 46.2, 0.99, 1.98} [max 46.2 from 1]
      #
      # Final state 3: (10.0) Weighted scores are {4, 8, 0, 5.5},
      #      New totals are {0.4, 48, 0, 2.2} [max 48 from 1]
      #
      #   Top scores are [39, 43.2, 46.2, 48] from [1, 1, 1, 1].
      #   Final multiplication results in [3.9, 4.32, 4.62, 24]
      #   Final state is [3] with a sequence of [1->3].
  
      sequence, score = viterbi_decode.decode(
          scores,
          transition_params,
          use_log_space=False,
          use_start_and_end_states=True,
      )
      self.assertAlmostEqual(24.0, score)
      self.assertEqual([1, 3], sequence)
  
file_path: text/tensorflow_text/python/numpy/viterbi_decode_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  import numpy
  from tensorflow_text.python.numpy import viterbi_decode
label_desc: Use image node_id 6 for calling the ViterbiDecodeTest obj's underlying member method code with example usage: obj.test_viterbi_in_exp_space_with_start_and_end() without return types