code: def test_crf_filtered_inputs(dtype):
      # Test both the length-1 and regular cases.
      sequence_lengths_list = [
          np.array(3, dtype=np.int32),
          np.array(1, dtype=np.int32),
      ]
      inputs_list = [
          np.array(
              [[4, 5, -3], [3, -1, 3], [-1, 2, 1], [0, 0, 0]],
              dtype=dtype,
          ),
          np.array([[4, 5, -3]], dtype=dtype),
      ]
      tag_bitmap_list = [
          np.array(
              [
                  [True, False, False],
                  [False, True, True],
                  [False, True, True],
                  [False, True, True],
              ],
              dtype=bool,
          ),
          np.array([[False, True, True]], dtype=bool),
      ]
      neg_inf = float("-inf")
      expected_filtered_inputs_list = [
          np.array(
              [
                  [4, neg_inf, neg_inf],
                  [neg_inf, -1, 3],
                  [neg_inf, 2, 1],
                  [neg_inf, 0, 0],
              ],
              dtype=dtype,
          ),
          np.array([[neg_inf, 5, -3]], dtype=dtype),
      ]
      for (
          sequence_lengths,
          inputs,
          tag_bitmap,
          expected_filtered_inputs,
      ) in zip(
          sequence_lengths_list,
          inputs_list,
          tag_bitmap_list,
          expected_filtered_inputs_list,
      ):
          filtered_inputs = text.crf_filtered_inputs(
              inputs=tf.expand_dims(inputs, 0),
              tag_bitmap=tf.expand_dims(tag_bitmap, 0),
          )
          filtered_inputs = tf.squeeze(filtered_inputs, [0])
  
          test_utils.assert_allclose_according_to_type(
              filtered_inputs, expected_filtered_inputs
          )
  
imports: import itertools
  from packaging.version import Version
  import pytest
  import numpy
  import tensorflow
  from tensorflow_addons import text
  from tensorflow_addons.utils import test_utils
  from numpy.testing import assert_array_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_crf_filtered_inputs(dtype) without return types