code: def test_crf_log_likelihood(dtype):
      inputs = np.array(
          [[4, 5, -3], [3, -1, 3], [-1, 2, 1], [0, 0, 0]], dtype=dtype
      )
      transition_params = np.array(
          [[-3, 5, -2], [3, 4, 1], [1, 2, 1]], dtype=dtype
      )
      sequence_lengths = np.array(3, dtype=np.int32)
  
      num_words = inputs.shape[0]
      num_tags = inputs.shape[1]
      all_sequence_log_likelihoods = []
  
      # Make sure all probabilities sum to 1.
      for tag_indices in itertools.product(
          range(num_tags), repeat=sequence_lengths
      ):
          tag_indices = list(tag_indices)
          tag_indices.extend([0] * (num_words - sequence_lengths))
          sequence_log_likelihood, _ = text.crf_log_likelihood(
              inputs=tf.expand_dims(inputs, 0),
              tag_indices=tf.expand_dims(tag_indices, 0),
              sequence_lengths=tf.expand_dims(sequence_lengths, 0),
              transition_params=tf.constant(transition_params),
          )
          all_sequence_log_likelihoods.append(sequence_log_likelihood)
      total_log_likelihood = tf.reduce_logsumexp(
          all_sequence_log_likelihoods
      )
      test_utils.assert_allclose_according_to_type(
          total_log_likelihood,
          0.0,
          rtol=1e-6,
          atol=1e-6,
          half_rtol=2e-3,
          half_atol=2e-3,
      )
  
      # check if `transition_params = None` raises an error
      text.crf_log_likelihood(
          inputs=tf.expand_dims(inputs, 0),
          tag_indices=tf.expand_dims(tag_indices, 0),
          sequence_lengths=tf.expand_dims(sequence_lengths, 0),
      )
  
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 10 for calling a global function with example usage: test_crf_log_likelihood(dtype) without return types