code: def test_numerical_accuracy():
      (
          logits,
          tags,
          transitions,
          boundary_values,
          crf_layer,
      ) = get_test_data_extended()
  
      x_input = tf.keras.layers.Input(shape=logits.shape[1:])
      crf_outputs = crf_layer(x_input)
      base_model = tf.keras.Model(x_input, crf_outputs)
      model = ModelWithCRFLoss(base_model)
  
      model.compile(optimizer="Adam")
      log_likelihood = model.train_on_batch(
          logits, tags, return_dict=True
      )["crf_loss"]
  
      # The manually computed log likelihood should
      # equal the result of crf.forward.
      expected_log_likelihood = compute_log_likelihood(
          logits, tags, transitions, boundary_values
      )
      unbatched_log_likelihood = -2 * log_likelihood
  
      test_utils.assert_allclose_according_to_type(
          expected_log_likelihood, unbatched_log_likelihood, rtol=5e-5
      )
  
imports: import itertools
  import os
  import math
  import tempfile
  import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.layers.crf import CRF
  from tensorflow_addons.text.crf import crf_log_likelihood
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 13 for calling a global function with example usage: test_numerical_accuracy() without return types