code: def rotate(
      point: type_alias.TensorLike,
      quaternion: type_alias.TensorLike,
      name: str = "quaternion_rotate",
  ) -> tf.Tensor:
      """Rotates a point using a quaternion.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        point: A tensor of shape `[A1, ..., An, 3]`, where the last dimension
          represents a 3d point.
        quaternion: A tensor of shape `[A1, ..., An, 4]`, where the last dimension
          represents a normalized quaternion.
        name: A name for this op that defaults to "quaternion_rotate".
  
      Returns:
        A tensor of shape `[A1, ..., An, 3]`, where the last dimension represents a
        3d point.
  
      Raises:
        ValueError: If the shape of `point` or `quaternion` is not supported.
      """
      with tf.name_scope(name):
          point = tf.convert_to_tensor(value=point)
          quaternion = tf.convert_to_tensor(value=quaternion)
  
          shape.check_static(
              tensor=point, tensor_name="point", has_dim_equals=(-1, 3)
          )
          shape.check_static(
              tensor=quaternion,
              tensor_name="quaternion",
              has_dim_equals=(-1, 4),
          )
          shape.compare_batch_dimensions(
              tensors=(point, quaternion),
              last_axes=-2,
              broadcast_compatible=True,
          )
          quaternion = asserts.assert_normalized(quaternion)
  
          padding = [[0, 0] for _ in range(point.shape.ndims)]
          padding[-1][-1] = 1
          point = tf.pad(
              tensor=point, paddings=padding, mode="CONSTANT"
          )
          point = multiply(quaternion, point)
          point = multiply(point, conjugate(quaternion))
          xyz, _ = tf.split(point, (3, 1), axis=-1)
          return xyz
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import List
  from six.moves import range
  import tensorflow
  from tensorflow_graphics.geometry.transformation import rotation_matrix_3d
  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 14 for calling a global function with example usage: rotate(point, quaternion, name) and returns: xyz