class_docstr: Computes the forward decoding in a linear-chain CRF.
class_docstr_tok: ["Computes","the","forward","decoding","in","a","linear-chain","CRF","."]
docstr: Build the CrfDecodeForwardRnnCell.
  
  Args:
    inputs: A [batch_size, num_tags] matrix of unary potentials.
    state: A [batch_size, num_tags] matrix containing the previous step's
          score values.
  
  Returns:
    output: A [batch_size, num_tags * 2] matrix of backpointers and scores.
    new_state: A [batch_size, num_tags] matrix of new score values.
docstr_tok: ["Build","the","CrfDecodeForwardRnnCell",".","Args",":","inputs",":","A","[","batch_size",",","num_tags","]","matrix","of","unary","potentials",".","state",":","A","[","batch_size",",","num_tags","]","matrix","containing","the","previous","step's","score","values",".","Returns",":","output",":","A","[","batch_size",",","num_tags","*","2","]","matrix","of","backpointers","and","scores",".","new_state",":","A","[","batch_size",",","num_tags","]","matrix","of","new","score","values","."]
code: def call(
      self, inputs: TensorLike, state: TensorLike
  ) -> Tuple[tf.Tensor, tf.Tensor]:
      """Build the CrfDecodeForwardRnnCell.
  
      Args:
        inputs: A [batch_size, num_tags] matrix of unary potentials.
        state: A [batch_size, num_tags] matrix containing the previous step's
              score values.
  
      Returns:
        output: A [batch_size, num_tags * 2] matrix of backpointers and scores.
        new_state: A [batch_size, num_tags] matrix of new score values.
      """
      state = tf.expand_dims(state[0], 2)
      transition_scores = state + self._transition_params
      new_state = inputs + tf.reduce_max(transition_scores, [1])
  
      backpointers = tf.argmax(transition_scores, 1)
      backpointers = tf.cast(backpointers, tf.float32)
  
      # apply softmax to transition_scores to get scores in range from 0 to 1
      scores = tf.reduce_max(
          tf.nn.softmax(transition_scores, axis=1), [1]
      )
  
      # In the RNN implementation only the first value that is returned from a cell
      # is kept throughout the RNN, so that you will have the values from each time
      # step in the final output. As we need the backpointers as well as the scores
      # for each time step, we concatenate them.
      return tf.concat([backpointers, scores], axis=1), new_state
  
imports: import tensorflow
  from tensorflow import TensorShape
  from tensorflow.types.experimental import TensorLike
  from typing import Tuple, Any, List, Union, Optional
label_desc: Use image node_id 5 for calling the CrfDecodeForwardRnnCell obj's underlying member method code with example usage: obj.call(inputs, state) and returns: tf,  new_state