code: def crf_filtered_inputs(
      inputs: TensorLike, tag_bitmap: TensorLike
  ) -> tf.Tensor:
      """Constrains the inputs to filter out certain tags at each time step.
  
      tag_bitmap limits the allowed tags at each input time step.
      This is useful when an observed output at a given time step needs to be
      constrained to a selected set of tags.
  
      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.
      Returns:
        filtered_inputs: A [batch_size] vector of unnormalized sequence scores.
      """
  
      # set scores of filtered out inputs to be -inf.
      filtered_inputs = tf.where(
          tag_bitmap,
          inputs,
          tf.fill(
              tf.shape(inputs), tf.cast(float("-inf"), inputs.dtype)
          ),
      )
      return filtered_inputs
  
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 1 for calling a global function with example usage: crf_filtered_inputs(inputs, tag_bitmap) and returns: filtered_inputs