code: def _cubic(position: tf.Tensor) -> tf.Tensor:
      """B-Spline basis functions of degree 3 for positions in the range [0, 1]."""
      # We pre-calculate the terms that are used multiple times.
      neg_pos = 1.0 - position
      pos_sq = tf.pow(position, 2.0)
      pos_cb = tf.pow(position, 3.0)
  
      # Piecewise cubic splines are C2 smooth.
      return tf.stack(
          (
              tf.pow(neg_pos, 3.0) / 6.0,
              (3.0 * pos_cb - 6.0 * pos_sq + 4.0) / 6.0,
              (-3.0 * pos_cb + 3.0 * pos_sq + 3.0 * position + 1.0)
              / 6.0,
              pos_cb / 6.0,
          ),
          axis=-1,
      )
  
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 4 for calling a global function with example usage: _cubic(position) and returns: tf