code: def assert_allclose_according_to_type(
      a,
      b,
      rtol=1e-6,
      atol=1e-6,
      float_rtol=1e-6,
      float_atol=1e-6,
      half_rtol=1e-3,
      half_atol=1e-3,
      bfloat16_rtol=1e-2,
      bfloat16_atol=1e-2,
  ):
      """
      Similar to tf.test.TestCase.assertAllCloseAccordingToType()
      but this doesn't need a subclassing to run.
      """
      a = np.array(a)
      b = np.array(b)
      # types with lower tol are put later to overwrite previous ones.
      if (
          a.dtype == np.float32
          or b.dtype == np.float32
          or a.dtype == np.complex64
          or b.dtype == np.complex64
      ):
          rtol = max(rtol, float_rtol)
          atol = max(atol, float_atol)
      if a.dtype == np.float16 or b.dtype == np.float16:
          rtol = max(rtol, half_rtol)
          atol = max(atol, half_atol)
      if (
          a.dtype == tf.bfloat16.as_numpy_dtype
          or b.dtype == tf.bfloat16.as_numpy_dtype
      ):
          rtol = max(rtol, bfloat16_rtol)
          atol = max(atol, bfloat16_atol)
  
      np.testing.assert_allclose(a, b, rtol=rtol, atol=atol)
  
imports: import os
  import random
  import inspect
  import numpy
  import pytest
  import tensorflow
  from tensorflow_addons import options
  from tensorflow_addons.utils import resource_loader
  from tensorflow_addons.utils.tf_test_utils import layer_test
label_desc: Use image node_id 19 for calling a global function with example usage: assert_allclose_according_to_type(a, b, rtol, atol, float_rtol, float_atol, half_rtol, half_atol, bfloat16_rtol, bfloat16_atol) without return types