code: def crf_decode_forward(
      inputs: TensorLike,
      state: TensorLike,
      transition_params: TensorLike,
      sequence_lengths: TensorLike,
  ) -> tf.Tensor:
      """Computes forward decoding in a linear-chain CRF.
  
      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.
        transition_params: A [num_tags, num_tags] matrix of binary potentials.
        sequence_lengths: A [batch_size] vector of true sequence lengths.
  
      Returns:
        backpointers: A [batch_size, num_tags] matrix of backpointers.
        new_state: A [batch_size, num_tags] matrix of new score values.
      """
      sequence_lengths = tf.cast(sequence_lengths, dtype=tf.int32)
      mask = tf.sequence_mask(sequence_lengths, tf.shape(inputs)[1])
      crf_fwd_cell = CrfDecodeForwardRnnCell(
          transition_params, dtype=inputs.dtype
      )
      crf_fwd_layer = tf.keras.layers.RNN(
          crf_fwd_cell,
          return_sequences=True,
          return_state=True,
          dtype=inputs.dtype,
          zero_output_for_mask=True,  # See: https://github.com/tensorflow/addons/issues/2639
      )
      return crf_fwd_layer(inputs, state, mask=mask)
  
imports: import warnings
  import numpy
  import tensorflow
  from tensorflow_addons.rnn.abstract_rnn_cell import AbstractRNNCell
  from tensorflow_addons.utils.types import TensorLike
  from typeguard import typechecked
  from typing import Optional, Tuple
label_desc: Use image node_id 10 for calling a global function with example usage: crf_decode_forward(inputs, state, transition_params, sequence_lengths) and returns: crf_fwd_layer