code: def interpolate(
      knots: type_alias.TensorLike,
      positions: type_alias.TensorLike,
      degree: int,
      cyclical: bool,
      name: str = "bspline_interpolate",
  ) -> tf.Tensor:
      """Applies B-spline interpolation to input control points (knots).
  
      Note:
        In the following, A1 to An, and B1 to Bk are optional batch dimensions.
  
      Args:
        knots: A tensor with shape `[B1, ..., Bk, C]` containing knot values, where
          `C` is the number of knots.
        positions: Tensor with shape `[A1, .. An]`. Positions must be between
          `[0, C - D)` for non-cyclical and `[0, C)` for cyclical splines, where `C`
          is the number of knots and `D` is the spline degree.
        degree: An `int` between 0 and 4, or an enumerated constant from the Degree
          class, which is the degree of the splines.
        cyclical: A `bool`, whether the splines are cyclical.
        name: A name for this op. Defaults to "bspline_interpolate".
  
      Returns:
        A tensor of shape `[A1, ... An, B1, ..., Bk]`, which is the result of spline
        interpolation.
      """
      with tf.name_scope(name):
          knots = tf.convert_to_tensor(value=knots)
          positions = tf.convert_to_tensor(value=positions)
  
          num_knots = knots.get_shape().as_list()[-1]
          weights = knot_weights(
              positions, num_knots, degree, cyclical, False, name
          )
          return interpolate_with_weights(knots, weights)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import enum
  from typing import Tuple, Union
  import tensorflow
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 8 for calling a global function with example usage: interpolate(knots, positions, degree, cyclical, name) and returns: interpolate_with_weights