(metric_tensor)
return {
      "eigenvalues": eigenvalues,
      "logdet": logdet,
      "log_condition_number": log_condition_number
  }
Analyzes a metric tensor.

  Args:
    metric_tensor: A numpy array of shape [batch, dim, dim]

  Returns:
    A dict containing spectral statstics.
Analyzes a metric tensor.
Analyzes a metric tensor .
def _analyze_metric_tensor(metric_tensor):
  """Analyzes a metric tensor.

  Args:
    metric_tensor: A numpy array of shape [batch, dim, dim]

  Returns:
    A dict containing spectral statstics.
  """
  # eigenvalues will have shape [batch, dim].
  eigenvalues, _ = np.linalg.eig(metric_tensor)

  # Shape [batch,].
  condition_number = np.linalg.cond(metric_tensor)
  log_condition_number = np.log(condition_number)
  (_, logdet) = np.linalg.slogdet(metric_tensor)

  return {
      "eigenvalues": eigenvalues,
      "logdet": logdet,
      "log_condition_number": log_condition_number
  }
def _analyze_metric_tensor ( metric_tensor ) : # eigenvalues will have shape [batch, dim]. eigenvalues , _ = np . linalg . eig ( metric_tensor ) # Shape [batch,]. condition_number = np . linalg . cond ( metric_tensor ) log_condition_number = np . log ( condition_number ) ( _ , logdet ) = np . linalg . slogdet ( metric_tensor ) return { "eigenvalues" : eigenvalues , "logdet" : logdet , "log_condition_number" : log_condition_number }