code: def make_eigh_marginal_fn(tol=1e-6, name="EigHMarginalFn"):
      """Make an eigenvalue decomposition-based `marginal_fn`.
  
      For use with `GaussianProcess` classes.
  
      A matrix square root is produced using an eigendecomposition. Eigenvalues are
      forced to be above a tolerance, to ensure positive-definiteness.
  
      Args:
        tol: Scalar float `Tensor`. Eigenvalues below `tol` are raised to `tol`.
        name: Python `str` name prefixed to Ops created by this function.
          Default value: 'EigHMarginalFn'.
  
      Returns:
        marginal_function: A function that can be used with the `marginal_fn`
          argument to `GaussianProcess`.
      """
  
      def eigh_marginal_fn(
          loc,
          covariance,
          validate_args=False,
          allow_nan_stats=False,
          name=name,
      ):
          """Compute EigH-based square root and return a MVN."""
          with tf.name_scope(name) as name:
              values, vectors = tf.linalg.eigh(covariance)
              safe_root = tf.math.sqrt(
                  tf.where(values < tol, tol, values)
              )
              scale = tf.linalg.LinearOperatorFullMatrix(
                  tf.einsum("...ij,...j->...ij", vectors, safe_root),
                  is_square=True,
                  is_positive_definite=True,
                  is_non_singular=True,
                  name="GaussianProcessEigHScaleLinearOperator",
              )
              return (
                  mvn_linear_operator.MultivariateNormalLinearOperator(
                      loc=loc,
                      scale=scale,
                      validate_args=validate_args,
                      allow_nan_stats=allow_nan_stats,
                      name=name,
                  )
              )
  
      return eigh_marginal_fn
  
file_path: probability/tensorflow_probability/python/experimental/distributions/marginal_fns.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import mvn_linear_operator
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 3 for calling a global function with example usage: make_eigh_marginal_fn(tol, name) and returns: eigh_marginal_fn, mvn_linear_operator