TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfg.math.interpolation.slerp.interpolate

Applies slerp to vectors or quaternions.

tfg.math.interpolation.slerp.interpolate(
    vector1,
    vector2,
    percent,
    method=tfg.math.interpolation.slerp.InterpolationType.QUATERNION,
    eps=None,
    name=None
)

Defined in math/interpolation/slerp.py.

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.