code: def _quadratic_form(
      matrix: type_alias.TensorLike, vector: type_alias.TensorLike
  ) -> tf.Tensor:
      """Computes the quadratic form between a matrix and a vector.
  
      The quadratic form between a matrix A and a vector x can be written as
      Q(x) = <x,Ax>, where <.,.> is the dot product operator.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        matrix: A tensor of shape `[A1, ..., An, C, C]`.
        vector: A tensor of shape `[A1, ..., An, 1, C]`.
  
      Returns:
        A tensor of shape `[A1, ..., An, 1]`.
      """
      vector_matrix = tf.matmul(vector, matrix)
      vector_matrix_vector = tf.matmul(
          vector_matrix, vector, transpose_b=True
      )
      return vector_matrix_vector
  
file_path: graphics/tensorflow_graphics/image/matting.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import List, Tuple, Union
  import numpy
  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 shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 2 for calling a global function with example usage: _quadratic_form(matrix, vector) and returns: vector_matrix_vector