code: def testContinuousGradients(self):
      # regression test for https://github.com/google/jax/issues/3024
  
      def loss(delta):
          x = np.arange(100.0)
          border = 10
          indices = np.arange(x.size, dtype=x.dtype) + delta
          # linear interpolation of the linear function y=x should be exact
          shifted = lsp_ndimage.map_coordinates(x, [indices], order=1)
          return ((x - shifted) ** 2)[border:-border].mean()
  
      # analytical gradient of (x - (x - delta)) ** 2 is 2 * delta
      self.assertAllClose(grad(loss)(0.5), 1.0, check_dtypes=False)
      self.assertAllClose(grad(loss)(1.0), 2.0, check_dtypes=False)
  
file_path: jax/tests/scipy_ndimage_test.py
imports: from functools import partial
  import math
  import numpy
  from absl.testing import absltest
  import scipy.ndimage
  from jax import grad
  from jax._src import test_util
  from jax import dtypes
  from jax.scipy import ndimage
  from jax import config
label_desc: Use image node_id 5 for calling the NdimageTest obj's underlying member method code with example usage: obj.testContinuousGradients() and returns: unknown