class_docstr: Space of parameterized discrete surfaces.
  
  Each surface is sampled with fixed `n_vertices` vertices and `n_faces`
  faces in :math:`\mathbb{R}^3`.
  
  Each individual surface is represented by a 2d-array of shape
  `[n_vertices, 3]`. This space corresponds to the space of immersions
  defined below, i.e. the
  space of smooth functions from a template to manifold :math:`M`
  into :math:`\mathbb{R}^3`, with non-vanishing Jacobian.
  
  .. math::
      Imm(M,\mathbb{R}^3)=\{ f \in C^{\infty}(M, \mathbb{R}^3)
      \|Df(x)\|\neq 0 \forall x \in M \}.
  
  Parameters
  ----------
  faces : integer array-like, shape=[n_faces, 3]
      Triangulation of the surface.
      Each face is given by 3 indices that indicate its vertices.
class_docstr_tok: ["Space","of","parameterized","discrete","surfaces",".","Each","surface","is","sampled","with","fixed","`","n_vertices","`","vertices","and","`","n_faces","`","faces","in",":","math",":","`","\\mathbb","{","R","}","^3","`",".","Each","individual","surface","is","represented","by","a","2d-array","of","shape","`","[","n_vertices",",","3","]","`",".","This","space","corresponds","to","the","space","of","immersions","defined","below",",","i.e",".","the","space","of","smooth","functions","from","a","template","to","manifold",":","math",":","`","M","`","into",":","math",":","`","\\mathbb","{","R","}","^3","`",",","with","non-vanishing","Jacobian",".","..","math",":",":","Imm","(","M",",","\\mathbb","{","R","}","^3",")","=\\","{","f","\\in","C^","{","\\infty","}","(","M",",","\\mathbb","{","R","}","^3",")","\\|Df","(","x",")","\\|\\neq","0","\\forall","x","\\in","M","\\","}",".","Parameters","--","--","--","--","--","faces",":","integer","array-like",",","shape=","[","n_faces",",","3","]","Triangulation","of","the","surface",".","Each","face","is","given","by","3","indices","that","indicate","its","vertices","."]
docstr: Compute the surface metric matrices directly from the one_forms.
  
  This function is useful for efficiency purposes.
  
  Parameters
  ----------
  one_forms : array-like, shape=[..., n_faces, 2, 3]
      One form evaluated at each face of the triangulated surface.
  
  Returns
  -------
  metric_mats : array-like, shape=[n_faces, 2, 2]
      Surface metric matrices evaluated at each face of
      the triangulated surface.
docstr_tok: ["Compute","the","surface","metric","matrices","directly","from","the","one_forms",".","This","function","is","useful","for","efficiency","purposes",".","Parameters","--","--","--","--","--","one_forms",":","array-like",",","shape=","[","...",",","n_faces",",","2",",","3","]","One","form","evaluated","at","each","face","of","the","triangulated","surface",".","Returns","--","--","--","-","metric_mats",":","array-like",",","shape=","[","n_faces",",","2",",","2","]","Surface","metric","matrices","evaluated","at","each","face","of","the","triangulated","surface","."]
code: def _surface_metric_matrices_from_one_forms(one_forms):
      """Compute the surface metric matrices directly from the one_forms.
  
      This function is useful for efficiency purposes.
  
      Parameters
      ----------
      one_forms : array-like, shape=[..., n_faces, 2, 3]
          One form evaluated at each face of the triangulated surface.
  
      Returns
      -------
      metric_mats : array-like, shape=[n_faces, 2, 2]
          Surface metric matrices evaluated at each face of
          the triangulated surface.
      """
      ndim = one_forms.ndim
      transpose_axes = tuple(range(ndim - 2)) + tuple(
          reversed(range(ndim - 2, ndim))
      )
      transposed_one_forms = gs.transpose(
          one_forms, axes=transpose_axes
      )
      return gs.matmul(one_forms, transposed_one_forms)
  
imports: import math
  import geomstats.backend
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.geometry.manifold import Manifold
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.numerics.optimizers import ScipyMinimize
label_desc: Use image node_id 14 for calling the DiscreteSurfaces obj's underlying member method code with example usage: obj._surface_metric_matrices_from_one_forms(one_forms) and returns: gs