class_docstr: Torch autograd Function wrapper EdgePointDistance Cuda implementation
docstr: Args:
      ctx: Context object used to calculate gradients.
      points: FloatTensor of shape `(P, 3)`
      points_first_idx: LongTensor of shape `(N,)` indicating the first point
          index for each example in the mesh
      segms: FloatTensor of shape `(S, 2, 3)` of edge segments. The `s`-th
          edge segment is spanned by `(segms[s, 0], segms[s, 1])`
      segms_first_idx: LongTensor of shape `(N,)` indicating the first edge
          index for each example in the mesh
      max_segms: Scalar equal to maximum number of edges in the batch
  Returns:
      dists: FloatTensor of shape `(S,)`, where `dists[s]` is the squared
          euclidean distance of `s`-th edge to the closest point in the
          corresponding example in the batch
      idxs: LongTensor of shape `(S,)` indicating the closest point in the
          corresponding example in the batch.
  
      `dists[s] = d(points[idxs[s]], edges[s, 0], edges[s, 1])`,
      where `d(u, v0, v1)` is the distance of point `u` from the segment
      spanned by `(v0, v1)`.
docstr_tok: ["Args",":","ctx",":","Context","object","used","to","calculate","gradients",".","points",":","FloatTensor","of","shape","`","(","P",",","3",")","`","points_first_idx",":","LongTensor","of","shape","`","(","N",",",")","`","indicating","the","first","point","index","for","each","example","in","the","mesh","segms",":","FloatTensor","of","shape","`","(","S",",","2",",","3",")","`","of","edge","segments",".","The","`","s","`","-th","edge","segment","is","spanned","by","`","(","segms","[","s",",","0","]",",","segms","[","s",",","1","]",")","`","segms_first_idx",":","LongTensor","of","shape","`","(","N",",",")","`","indicating","the","first","edge","index","for","each","example","in","the","mesh","max_segms",":","Scalar","equal","to","maximum","number","of","edges","in","the","batch","Returns",":","dists",":","FloatTensor","of","shape","`","(","S",",",")","`",",","where","`","dists","[","s","]","`","is","the","squared","euclidean","distance","of","`","s","`","-th","edge","to","the","closest","point","in","the","corresponding","example","in","the","batch","idxs",":","LongTensor","of","shape","`","(","S",",",")","`","indicating","the","closest","point","in","the","corresponding","example","in","the","batch",".","`","dists","[","s","]","=","d","(","points","[","idxs","[","s","]","]",",","edges","[","s",",","0","]",",","edges","[","s",",","1","]",")","`",",","where","`","d","(","u",",","v0",",","v1",")","`","is","the","distance","of","point","`","u","`","from","the","segment","spanned","by","`","(","v0",",","v1",")","`","."]
code: def forward(
      ctx, points, points_first_idx, segms, segms_first_idx, max_segms
  ):
      """
      Args:
          ctx: Context object used to calculate gradients.
          points: FloatTensor of shape `(P, 3)`
          points_first_idx: LongTensor of shape `(N,)` indicating the first point
              index for each example in the mesh
          segms: FloatTensor of shape `(S, 2, 3)` of edge segments. The `s`-th
              edge segment is spanned by `(segms[s, 0], segms[s, 1])`
          segms_first_idx: LongTensor of shape `(N,)` indicating the first edge
              index for each example in the mesh
          max_segms: Scalar equal to maximum number of edges in the batch
      Returns:
          dists: FloatTensor of shape `(S,)`, where `dists[s]` is the squared
              euclidean distance of `s`-th edge to the closest point in the
              corresponding example in the batch
          idxs: LongTensor of shape `(S,)` indicating the closest point in the
              corresponding example in the batch.
  
          `dists[s] = d(points[idxs[s]], edges[s, 0], edges[s, 1])`,
          where `d(u, v0, v1)` is the distance of point `u` from the segment
          spanned by `(v0, v1)`.
      """
      dists, idxs = _C.edge_point_dist_forward(
          points, points_first_idx, segms, segms_first_idx, max_segms
      )
      ctx.save_for_backward(points, segms, idxs)
      return dists
  
imports: from pytorch3d import _C
  from pytorch3d.structures import Meshes, Pointclouds
  from torch.autograd import Function
  from torch.autograd.function import once_differentiable
label_desc: Use image node_id 1 for calling the _EdgePointDistance obj's underlying member method code with example usage: obj.forward(ctx, points, points_first_idx, segms, segms_first_idx, max_segms) and returns: dists