docstr: Tests that Jacobian is correct.
docstr_tok: ["Tests","that","Jacobian","is","correct","."]
code: def test_knot_weights_jacobian_is_correct(
      self, num_knots, degree, cyclical
  ):
      """Tests that Jacobian is correct."""
      positions_init = np.random.random_sample((10, 1))
      scale = num_knots if cyclical else num_knots - degree
      positions_init *= scale
  
      def dense_mode_fn(positions):
          return bspline.knot_weights(
              positions=positions,
              num_knots=num_knots,
              degree=degree,
              cyclical=cyclical,
              sparse_mode=False,
          )
  
      def sparse_mode_fn(positions):
          return bspline.knot_weights(
              positions=positions,
              num_knots=num_knots,
              degree=degree,
              cyclical=cyclical,
              sparse_mode=True,
          )[0]
  
      with self.subTest(name="dense_mode"):
          self.assert_jacobian_is_correct_fn(
              dense_mode_fn, [positions_init]
          )
  
      with self.subTest(name="sparse_mode"):
          self.assert_jacobian_is_correct_fn(
              sparse_mode_fn, [positions_init]
          )
  
file_path: graphics/tensorflow_graphics/math/interpolation/tests/bspline_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow_graphics.math.interpolation import bspline
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 13 for calling the BSplineTest obj's underlying member method code with example usage: obj.test_knot_weights_jacobian_is_correct(num_knots, degree, cyclical) and returns: bspline, bspline