code: def interpolate(
      vector1: type_alias.TensorLike,
      vector2: type_alias.TensorLike,
      percent: type_alias.Float,
      method: InterpolationType = InterpolationType.QUATERNION,
      eps: Optional[type_alias.Float] = None,
      name: Optional[str] = None,
  ) -> tf.Tensor:
      """Applies slerp to vectors or quaternions.
  
      Args:
        vector1: A tensor of shape `[A1, ... , An, M]`, which stores a normalized
          vector in its last dimension.
        vector2: A tensor of shape `[A1, ... , An, M]`, which stores a normalized
          vector in its last dimension.
        percent: A `float` or a tensor with shape broadcastable to the shape of
          input vectors.
        method: An enumerated constant from the class InterpolationType, which is
          either InterpolationType.QUATERNION (default) if the input vectors are 4-D
          quaternions, or InterpolationType.VECTOR if they are regular M-D vectors.
        eps: A small float for operation safety. If left None, its value is
          automatically selected using dtype of input vectors.
        name: A name for this op. Defaults to "vector_weights" or
          "quaternion_weights" depending on the method.
  
      Returns:
        A tensor of shape [A1, ... , An, M]` which stores the result of the
        interpolation.
  
      Raises:
        ValueError: if method is not amongst enumerated constants defined in
          InterpolationType.
      """
      if method == InterpolationType.QUATERNION:
          if name is None:
              name = "quaternion_weights"
          weight1, weight2 = quaternion_weights(
              vector1, vector2, percent, eps=eps, name=name
          )
      elif method == InterpolationType.VECTOR:
          if name is None:
              name = "vector_weights"
          weight1, weight2 = vector_weights(
              vector1, vector2, percent, eps=eps, name=name
          )
      else:
          raise ValueError("Unknown interpolation type supplied.")
      return interpolate_with_weights(
          vector1, vector2, weight1, weight2
      )
  
file_path: graphics/tensorflow_graphics/math/interpolation/slerp.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import enum
  from typing import Optional, Tuple, Union
  import tensorflow
  from tensorflow_graphics.math import vector
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import safe_ops
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 2 for calling a global function with example usage: interpolate(vector1, vector2, percent, method, eps, name) and returns: interpolate_with_weights