code: def crf_multitag_sequence_score(
      inputs: TensorLike,
      tag_bitmap: TensorLike,
      sequence_lengths: TensorLike,
      transition_params: TensorLike,
  ) -> tf.Tensor:
      """Computes the unnormalized score of all tag sequences matching
      tag_bitmap.
  
      tag_bitmap enables more than one tag to be considered correct at each time
      step. This is useful when an observed output at a given time step is
      consistent with more than one tag, and thus the log likelihood of that
      observation must take into account all possible consistent tags.
  
      Using one-hot vectors in tag_bitmap gives results identical to
      crf_sequence_score.
  
      Args:
        inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials
            to use as input to the CRF layer.
        tag_bitmap: A [batch_size, max_seq_len, num_tags] boolean tensor
            representing all active tags at each index for which to calculate the
            unnormalized score.
        sequence_lengths: A [batch_size] vector of true sequence lengths.
        transition_params: A [num_tags, num_tags] transition matrix.
      Returns:
        sequence_scores: A [batch_size] vector of unnormalized sequence scores.
      """
      tag_bitmap = tf.cast(tag_bitmap, dtype=tf.bool)
      sequence_lengths = tf.cast(sequence_lengths, dtype=tf.int32)
      filtered_inputs = crf_filtered_inputs(inputs, tag_bitmap)
  
      # If max_seq_len is 1, we skip the score calculation and simply gather the
      # unary potentials of all active tags.
      def _single_seq_fn():
          return tf.reduce_logsumexp(
              filtered_inputs, axis=[1, 2], keepdims=False
          )
  
      def _multi_seq_fn():
          # Compute the logsumexp of all scores of sequences
          # matching the given tags.
          return crf_log_norm(
              inputs=filtered_inputs,
              sequence_lengths=sequence_lengths,
              transition_params=transition_params,
          )
  
      return tf.cond(
          tf.equal(tf.shape(inputs)[1], 1),
          _single_seq_fn,
          _multi_seq_fn,
      )
  
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 3 for calling a global function with example usage: crf_multitag_sequence_score(inputs, tag_bitmap, sequence_lengths, transition_params) and returns: tf, tf, crf_log_norm