code: def dot(
      vector1: TensorLike,
      vector2: TensorLike,
      axis: int = -1,
      keepdims: bool = True,
      name: str = "vector_dot",
  ) -> TensorLike:
      """Computes the dot product between two tensors along an axis.
  
      Note:
        In the following, A1 to An are optional batch dimensions, which should be
        broadcast compatible.
  
      Args:
        vector1: Tensor of rank R and shape `[A1, ..., Ai, ..., An]`, where the
          dimension i = axis represents a vector.
        vector2: Tensor of rank R and shape `[A1, ..., Ai, ..., An]`, where the
          dimension i = axis represents a vector.
        axis: The dimension along which to compute the dot product.
        keepdims: If True, retains reduced dimensions with length 1.
        name: A name for this op which defaults to "vector_dot".
  
      Returns:
        A tensor of shape `[A1, ..., Ai = 1, ..., An]`, where the dimension i = axis
        represents the result of the dot product.
      """
      with tf.name_scope(name):
          vector1 = tf.convert_to_tensor(value=vector1)
          vector2 = tf.convert_to_tensor(value=vector2)
  
          shape.compare_batch_dimensions(
              tensors=(vector1, vector2),
              last_axes=-1,
              broadcast_compatible=True,
          )
          shape.compare_dimensions(
              tensors=(vector1, vector2),
              axes=axis,
              tensor_names=("vector1", "vector2"),
          )
  
          return tf.reduce_sum(
              input_tensor=vector1 * vector2,
              axis=axis,
              keepdims=keepdims,
          )
  
file_path: graphics/tensorflow_graphics/math/vector.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  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.type_alias import TensorLike
label_desc: Use image node_id 2 for calling a global function with example usage: dot(vector1, vector2, axis, keepdims, name) and returns: tf