code: def _assert_correct_interpolation_value(
      image,
      flows,
      pred_interpolation,
      batch_index,
      y_index,
      x_index,
      low_precision=False,
  ):
      """Assert that the tf interpolation matches hand-computed value."""
      height = image.shape[1]
      width = image.shape[2]
      displacement = flows[batch_index, y_index, x_index, :]
      float_y = y_index - displacement[0]
      float_x = x_index - displacement[1]
      floor_y = max(min(height - 2, math.floor(float_y)), 0)
      floor_x = max(min(width - 2, math.floor(float_x)), 0)
      ceil_y = floor_y + 1
      ceil_x = floor_x + 1
  
      alpha_y = min(max(0.0, float_y - floor_y), 1.0)
      alpha_x = min(max(0.0, float_x - floor_x), 1.0)
  
      floor_y = int(floor_y)
      floor_x = int(floor_x)
      ceil_y = int(ceil_y)
      ceil_x = int(ceil_x)
  
      top_left = image[batch_index, floor_y, floor_x, :]
      top_right = image[batch_index, floor_y, ceil_x, :]
      bottom_left = image[batch_index, ceil_y, floor_x, :]
      bottom_right = image[batch_index, ceil_y, ceil_x, :]
  
      interp_top = alpha_x * (top_right - top_left) + top_left
      interp_bottom = (
          alpha_x * (bottom_right - bottom_left) + bottom_left
      )
      interp = alpha_y * (interp_bottom - interp_top) + interp_top
      atol = 1e-6
      rtol = 1e-6
      if low_precision:
          atol = 1e-2
          rtol = 1e-3
      np.testing.assert_allclose(
          interp,
          pred_interpolation[batch_index, y_index, x_index, :],
          atol=atol,
          rtol=rtol,
      )
  
file_path: addons/tensorflow_addons/image/tests/dense_image_warp_test.py
imports: import pytest
  import math
  import numpy
  import tensorflow
  from tensorflow_addons.image import dense_image_warp
  from tensorflow_addons.image import interpolate_bilinear
label_desc: Use image node_id 8 for calling a global function with example usage: _assert_correct_interpolation_value(image, flows, pred_interpolation, batch_index, y_index, x_index, low_precision) without return types