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 vertex areas for a triangulated surface.
  
  Vertex area is the area of all of the triangles who are in contact (incident)
  with a specific vertex, according to the formula:
  vertex_areas = 2 * sum_incident_areas / 3.0
  
  Parameters
  ----------
  point : array-like, shape=[..., n_vertices, 3]
       Surface, as the 3D coordinates of the vertices of its triangulation.
  
  Returns
  -------
  vertex_areas :  array-like, shape=[..., n_vertices, 1]
      Vertex area for each vertex.
docstr_tok: ["Compute","vertex","areas","for","a","triangulated","surface",".","Vertex","area","is","the","area","of","all","of","the","triangles","who","are","in","contact","(","incident",")","with","a","specific","vertex",",","according","to","the","formula",":","vertex_areas","=","2","*","sum_incident_areas","\/","3.0","Parameters","--","--","--","--","--","point",":","array-like",",","shape=","[","...",",","n_vertices",",","3","]","Surface",",","as","the","3D","coordinates","of","the","vertices","of","its","triangulation",".","Returns","--","--","--","-","vertex_areas",":","array-like",",","shape=","[","...",",","n_vertices",",","1","]","Vertex","area","for","each","vertex","."]
code: def vertex_areas(self, point):
      """Compute vertex areas for a triangulated surface.
  
      Vertex area is the area of all of the triangles who are in contact (incident)
      with a specific vertex, according to the formula:
      vertex_areas = 2 * sum_incident_areas / 3.0
  
      Parameters
      ----------
      point : array-like, shape=[..., n_vertices, 3]
           Surface, as the 3D coordinates of the vertices of its triangulation.
  
      Returns
      -------
      vertex_areas :  array-like, shape=[..., n_vertices, 1]
          Vertex area for each vertex.
      """
      batch_shape = point.shape[:-2]
      n_vertices = point.shape[-2]
      n_faces = self.faces.shape[0]
      area = self._triangle_areas(point)
      id_vertices = gs.broadcast_to(
          gs.flatten(self.faces),
          batch_shape + (math.prod(self.faces.shape),),
      )
      incident_areas = gs.zeros(batch_shape + (n_vertices,))
      val = gs.reshape(
          gs.broadcast_to(
              gs.expand_dims(area, axis=-2), batch_shape + (3, n_faces)
          ),
          batch_shape + (-1,),
      )
      incident_areas = gs.scatter_add(
          gs.cast(incident_areas, dtype=val.dtype),
          dim=len(batch_shape),
          index=id_vertices,
          src=val,
      )
      vertex_areas = 2 * incident_areas / 3.0
      return vertex_areas
  
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 10 for calling the DiscreteSurfaces obj's underlying member method code with example usage: obj.vertex_areas(point) and returns: vertex_areas