class_docstr: Cycle Loss for Shapes.
  Inspired by:
  "Mapping in a Cycle: Sinkhorn Regularized Unsupervised Learning for Point Cloud Shapes".
docstr: Produces embeddings and geodesic distance tensors for a given mesh. May subsample
  the mesh, if it contains too many vertices (controlled by
  SHAPE_CYCLE_LOSS_MAX_NUM_VERTICES parameter).
  Args:
      embedder (nn.Module): module that computes embeddings for mesh vertices
      mesh_name (str): mesh name
  Return:
      embeddings (torch.Tensor of size [N, D]): embeddings for selected mesh
          vertices (N = number of selected vertices, D = embedding space dim)
      geodists (torch.Tensor of size [N, N]): geodesic distances for the selected
          mesh vertices (N = number of selected vertices)
docstr_tok: ["Produces","embeddings","and","geodesic","distance","tensors","for","a","given","mesh",".","May","subsample","the","mesh",",","if","it","contains","too","many","vertices","(","controlled","by","SHAPE_CYCLE_LOSS_MAX_NUM_VERTICES","parameter",")",".","Args",":","embedder","(","nn.Module",")",":","module","that","computes","embeddings","for","mesh","vertices","mesh_name","(","str",")",":","mesh","name","Return",":","embeddings","(","torch.Tensor","of","size","[","N",",","D","]",")",":","embeddings","for","selected","mesh","vertices","(","N","=","number","of","selected","vertices",",","D","=","embedding","space","dim",")","geodists","(","torch.Tensor","of","size","[","N",",","N","]",")",":","geodesic","distances","for","the","selected","mesh","vertices","(","N","=","number","of","selected","vertices",")"]
code: def _get_embeddings_and_geodists_for_mesh(
      self, embedder: nn.Module, mesh_name: str
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """
      Produces embeddings and geodesic distance tensors for a given mesh. May subsample
      the mesh, if it contains too many vertices (controlled by
      SHAPE_CYCLE_LOSS_MAX_NUM_VERTICES parameter).
      Args:
          embedder (nn.Module): module that computes embeddings for mesh vertices
          mesh_name (str): mesh name
      Return:
          embeddings (torch.Tensor of size [N, D]): embeddings for selected mesh
              vertices (N = number of selected vertices, D = embedding space dim)
          geodists (torch.Tensor of size [N, N]): geodesic distances for the selected
              mesh vertices (N = number of selected vertices)
      """
      embeddings = embedder(mesh_name)
      indices = sample_random_indices(
          embeddings.shape[0], self.max_num_vertices, embeddings.device
      )
      mesh = create_mesh(mesh_name, embeddings.device)
      geodists = mesh.geodists
      if indices is not None:
          embeddings = embeddings[indices]
          geodists = geodists[torch.meshgrid(indices, indices)]
      return embeddings, geodists
  
file_path: detectron2/projects/DensePose/densepose/modeling/losses/cycle_shape2shape.py
imports: import random
  from typing import Tuple
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import CfgNode
  from densepose.structures.mesh import create_mesh
  from .utils import sample_random_indices
label_desc: Use image node_id 5 for calling the ShapeToShapeCycleLoss obj's underlying member method code with example usage: obj._get_embeddings_and_geodists_for_mesh(embedder, mesh_name) and returns: embeddings,  geodists