code: def triangle_area(
      vertex0: type_alias.TensorLike,
      vertex1: type_alias.TensorLike,
      vertex2: type_alias.TensorLike,
      name: str = "triangle_area",
  ) -> type_alias.TensorLike:
      """Computes triangle areas.
  
      Note:
        Computed triangle area = 0.5 * | e1 x e2 | where e1 and e2 are edges
          of triangle.
  
        In the following, A1 to An are optional batch dimensions, which must be
        broadcast compatible.
  
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        vertex0: A tensor of shape `[A1, ..., An, 3]`, where the last dimension
          represents the first vertex of a triangle.
        vertex1: A tensor of shape `[A1, ..., An, 3]`, where the last dimension
          represents the second vertex of a triangle.
        vertex2: A tensor of shape `[A1, ..., An, 3]`, where the last dimension
          represents the third vertex of a triangle.
        name: A name for this op. Defaults to "triangle_area".
  
      Returns:
        A tensor of shape `[A1, ..., An, 1]`, where the last dimension represents
          the triangle areas.
      """
      with tf.name_scope(name):
          vertex0 = tf.convert_to_tensor(value=vertex0)
          vertex1 = tf.convert_to_tensor(value=vertex1)
          vertex2 = tf.convert_to_tensor(value=vertex2)
  
          triangle_normals = triangle.normal(
              vertex0, vertex1, vertex2, normalize=False
          )
          areas = 0.5 * tf.linalg.norm(tensor=triangle_normals, axis=-1)
          return areas
  
file_path: graphics/tensorflow_graphics/geometry/representation/mesh/sampler.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Tuple
  import tensorflow
  from tensorflow_graphics.geometry.representation import triangle
  from tensorflow_graphics.geometry.representation.mesh import normals
  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 1 for calling a global function with example usage: triangle_area(vertex0, vertex1, vertex2, name) and returns: areas