class_docstr: This class provides functions for working with batches of triangulated
  meshes with varying numbers of faces and vertices, and converting between
  representations.
  
  Within Meshes, there are three different representations of the faces and
  verts data:
  
  List
    - only used for input as a starting point to convert to other representations.
  Padded
    - has specific batch dimension.
  Packed
    - no batch dimension.
    - has auxiliary variables used to index into the padded representation.
  
  Example:
  
  Input list of verts V_n = [[V_1], [V_2], ... , [V_N]]
  where V_1, ... , V_N are the number of verts in each mesh and N is the
  number of meshes.
  
  Input list of faces F_n = [[F_1], [F_2], ... , [F_N]]
  where F_1, ... , F_N are the number of faces in each mesh.
  
  # SPHINX IGNORE
   List                      | Padded                  | Packed
  ---------------------------|-------------------------|------------------------
  [[V_1], ... , [V_N]]       | size = (N, max(V_n), 3) |  size = (sum(V_n), 3)
                             |                         |
  Example for verts:         |                         |
                             |                         |
  V_1 = 3, V_2 = 4, V_3 = 5  | size = (3, 5, 3)        |  size = (12, 3)
                             |                         |
  List([                     | tensor([                |  tensor([
    [                        |     [                   |    [0.1, 0.3, 0.5],
      [0.1, 0.3, 0.5],       |       [0.1, 0.3, 0.5],  |    [0.5, 0.2, 0.1],
      [0.5, 0.2, 0.1],       |       [0.5, 0.2, 0.1],  |    [0.6, 0.8, 0.7],
      [0.6, 0.8, 0.7],       |       [0.6, 0.8, 0.7],  |    [0.1, 0.3, 0.3],
    ],                       |       [0,    0,    0],  |    [0.6, 0.7, 0.8],
    [                        |       [0,    0,    0],  |    [0.2, 0.3, 0.4],
      [0.1, 0.3, 0.3],       |     ],                  |    [0.1, 0.5, 0.3],
      [0.6, 0.7, 0.8],       |     [                   |    [0.7, 0.3, 0.6],
      [0.2, 0.3, 0.4],       |       [0.1, 0.3, 0.3],  |    [0.2, 0.4, 0.8],
      [0.1, 0.5, 0.3],       |       [0.6, 0.7, 0.8],  |    [0.9, 0.5, 0.2],
    ],                       |       [0.2, 0.3, 0.4],  |    [0.2, 0.3, 0.4],
    [                        |       [0.1, 0.5, 0.3],  |    [0.9, 0.3, 0.8],
      [0.7, 0.3, 0.6],       |       [0,    0,    0],  |  ])
      [0.2, 0.4, 0.8],       |     ],                  |
      [0.9, 0.5, 0.2],       |     [                   |
      [0.2, 0.3, 0.4],       |       [0.7, 0.3, 0.6],  |
      [0.9, 0.3, 0.8],       |       [0.2, 0.4, 0.8],  |
    ]                        |       [0.9, 0.5, 0.2],  |
  ])                         |       [0.2, 0.3, 0.4],  |
                             |       [0.9, 0.3, 0.8],  |
                             |     ]                   |
                             |  ])                     |
  Example for faces:         |                         |
                             |                         |
  F_1 = 1, F_2 = 2, F_3 = 7  | size = (3, 7, 3)        | size = (10, 3)
                             |                         |
  List([                     | tensor([                | tensor([
    [                        |     [                   |    [ 0,  1,  2],
      [0, 1, 2],             |       [0,   1,  2],     |    [ 3,  4,  5],
    ],                       |       [-1, -1, -1],     |    [ 4,  5,  6],
    [                        |       [-1, -1, -1]      |    [ 8,  9,  7],
      [0, 1, 2],             |       [-1, -1, -1]      |    [ 7,  8, 10],
      [1, 2, 3],             |       [-1, -1, -1]      |    [ 9, 10,  8],
    ],                       |       [-1, -1, -1],     |    [11, 10,  9],
    [                        |       [-1, -1, -1],     |    [11,  7,  8],
      [1, 2, 0],             |     ],                  |    [11, 10,  8],
      [0, 1, 3],             |     [                   |    [11,  9,  8],
      [2, 3, 1],             |       [0,   1,  2],     |  ])
      [4, 3, 2],             |       [1,   2,  3],     |
      [4, 0, 1],             |       [-1, -1, -1],     |
      [4, 3, 1],             |       [-1, -1, -1],     |
      [4, 2, 1],             |       [-1, -1, -1],     |
    ],                       |       [-1, -1, -1],     |
  ])                         |       [-1, -1, -1],     |
                             |     ],                  |
                             |     [                   |
                             |       [1,   2,  0],     |
                             |       [0,   1,  3],     |
                             |       [2,   3,  1],     |
                             |       [4,   3,  2],     |
                             |       [4,   0,  1],     |
                             |       [4,   3,  1],     |
                             |       [4,   2,  1],     |
                             |     ]                   |
                             |   ])                    |
  -----------------------------------------------------------------------------
  
  Auxiliary variables for packed representation
  
  Name                           |   Size              |  Example from above
  -------------------------------|---------------------|-----------------------
                                 |                     |
  verts_packed_to_mesh_idx       |  size = (sum(V_n))  |   tensor([
                                 |                     |     0, 0, 0, 1, 1, 1,
                                 |                     |     1, 2, 2, 2, 2, 2
                                 |                     |   )]
                                 |                     |   size = (12)
                                 |                     |
  mesh_to_verts_packed_first_idx |  size = (N)         |   tensor([0, 3, 7])
                                 |                     |   size = (3)
                                 |                     |
  num_verts_per_mesh             |  size = (N)         |   tensor([3, 4, 5])
                                 |                     |   size = (3)
                                 |                     |
  faces_packed_to_mesh_idx       |  size = (sum(F_n))  |   tensor([
                                 |                     |     0, 1, 1, 2, 2, 2,
                                 |                     |     2, 2, 2, 2
                                 |                     |   )]
                                 |                     |   size = (10)
                                 |                     |
  mesh_to_faces_packed_first_idx |  size = (N)         |   tensor([0, 1, 3])
                                 |                     |   size = (3)
                                 |                     |
  num_faces_per_mesh             |  size = (N)         |   tensor([1, 2, 7])
                                 |                     |   size = (3)
                                 |                     |
  verts_padded_to_packed_idx     |  size = (sum(V_n))  |  tensor([
                                 |                     |     0, 1, 2, 5, 6, 7,
                                 |                     |     8, 10, 11, 12, 13,
                                 |                     |     14
                                 |                     |  )]
                                 |                     |  size = (12)
  -----------------------------------------------------------------------------
  # SPHINX IGNORE
  
  From the faces, edges are computed and have packed and padded
  representations with auxiliary variables.
  
  E_n = [[E_1], ... , [E_N]]
  where E_1, ... , E_N are the number of unique edges in each mesh.
  Total number of unique edges = sum(E_n)
  
  # SPHINX IGNORE
  Name                           |   Size                  | Example from above
  -------------------------------|-------------------------|----------------------
                                 |                         |
  edges_packed                   | size = (sum(E_n), 2)    |  tensor([
                                 |                         |     [0, 1],
                                 |                         |     [0, 2],
                                 |                         |     [1, 2],
                                 |                         |       ...
                                 |                         |     [10, 11],
                                 |                         |   )]
                                 |                         |   size = (18, 2)
                                 |                         |
  num_edges_per_mesh             | size = (N)              |  tensor([3, 5, 10])
                                 |                         |  size = (3)
                                 |                         |
  edges_packed_to_mesh_idx       | size = (sum(E_n))       |  tensor([
                                 |                         |    0, 0, 0,
                                 |                         |     . . .
                                 |                         |    2, 2, 2
                                 |                         |   ])
                                 |                         |   size = (18)
                                 |                         |
  faces_packed_to_edges_packed   | size = (sum(F_n), 3)    |  tensor([
                                 |                         |    [2,   1,  0],
                                 |                         |    [5,   4,  3],
                                 |                         |       .  .  .
                                 |                         |    [12, 14, 16],
                                 |                         |   ])
                                 |                         |   size = (10, 3)
                                 |                         |
  mesh_to_edges_packed_first_idx | size = (N)              |  tensor([0, 3, 8])
                                 |                         |  size = (3)
  ----------------------------------------------------------------------------
  # SPHINX IGNORE
class_docstr_tok: ["This","class","provides","functions","for","working","with","batches","of","triangulated","meshes","with","varying","numbers","of","faces","and","vertices",",","and","converting","between","representations",".","Within","Meshes",",","there","are","three","different","representations","of","the","faces","and","verts","data",":","List","-","only","used","for","input","as","a","starting","point","to","convert","to","other","representations",".","Padded","-","has","specific","batch","dimension",".","Packed","-","no","batch","dimension",".","-","has","auxiliary","variables","used","to","index","into","the","padded","representation",".","Example",":","Input","list","of","verts","V_n","=","[","[","V_1","]",",","[","V_2","]",",","...",",","[","V_N","]","]","where","V_1",",","...",",","V_N","are","the","number","of","verts","in","each","mesh","and","N","is","the","number","of","meshes",".","Input","list","of","faces","F_n","=","[","[","F_1","]",",","[","F_2","]",",","...",",","[","F_N","]","]","where","F_1",",","...",",","F_N","are","the","number","of","faces","in","each","mesh",".","#","SPHINX","IGNORE","List","|","Padded","|","Packed","--","--","--","--","--","--","--","--","--","--","--","--","--","-|","--","--","--","--","--","--","--","--","--","--","--","--","-|","--","--","--","--","--","--","--","--","--","--","--","--","[","[","V_1","]",",","...",",","[","V_N","]","]","|","size","=","(","N",",","max","(","V_n",")",",","3",")","|","size","=","(","sum","(","V_n",")",",","3",")","|","|","Example","for","verts",":","|","|","|","|","V_1","=","3",",","V_2","=","4",",","V_3","=","5","|","size","=","(","3",",","5",",","3",")","|","size","=","(","12",",","3",")","|","|","List","(","[","|","tensor","(","[","|","tensor","(","[","[","|","[","|","[","0.1",",","0.3",",","0.5","]",",","[","0.1",",","0.3",",","0.5","]",",","|","[","0.1",",","0.3",",","0.5","]",",","|","[","0.5",",","0.2",",","0.1","]",",","[","0.5",",","0.2",",","0.1","]",",","|","[","0.5",",","0.2",",","0.1","]",",","|","[","0.6",",","0.8",",","0.7","]",",","[","0.6",",","0.8",",","0.7","]",",","|","[","0.6",",","0.8",",","0.7","]",",","|","[","0.1",",","0.3",",","0.3","]",",","]",",","|","[","0",",","0",",","0","]",",","|","[","0.6",",","0.7",",","0.8","]",",","[","|","[","0",",","0",",","0","]",",","|","[","0.2",",","0.3",",","0.4","]",",","[","0.1",",","0.3",",","0.3","]",",","|","]",",","|","[","0.1",",","0.5",",","0.3","]",",","[","0.6",",","0.7",",","0.8","]",",","|","[","|","[","0.7",",","0.3",",","0.6","]",",","[","0.2",",","0.3",",","0.4","]",",","|","[","0.1",",","0.3",",","0.3","]",",","|","[","0.2",",","0.4",",","0.8","]",",","[","0.1",",","0.5",",","0.3","]",",","|","[","0.6",",","0.7",",","0.8","]",",","|","[","0.9",",","0.5",",","0.2","]",",","]",",","|","[","0.2",",","0.3",",","0.4","]",",","|","[","0.2",",","0.3",",","0.4","]",",","[","|","[","0.1",",","0.5",",","0.3","]",",","|","[","0.9",",","0.3",",","0.8","]",",","[","0.7",",","0.3",",","0.6","]",",","|","[","0",",","0",",","0","]",",","|","]",")","[","0.2",",","0.4",",","0.8","]",",","|","]",",","|","[","0.9",",","0.5",",","0.2","]",",","|","[","|","[","0.2",",","0.3",",","0.4","]",",","|","[","0.7",",","0.3",",","0.6","]",",","|","[","0.9",",","0.3",",","0.8","]",",","|","[","0.2",",","0.4",",","0.8","]",",","|","]","|","[","0.9",",","0.5",",","0.2","]",",","|","]",")","|","[","0.2",",","0.3",",","0.4","]",",","|","|","[","0.9",",","0.3",",","0.8","]",",","|","|","]","|","|","]",")","|","Example","for","faces",":","|","|","|","|","F_1","=","1",",","F_2","=","2",",","F_3","=","7","|","size","=","(","3",",","7",",","3",")","|","size","=","(","10",",","3",")","|","|","List","(","[","|","tensor","(","[","|","tensor","(","[","[","|","[","|","[","0",",","1",",","2","]",",","[","0",",","1",",","2","]",",","|","[","0",",","1",",","2","]",",","|","[","3",",","4",",","5","]",",","]",",","|","[","-1",",","-1",",","-1","]",",","|","[","4",",","5",",","6","]",",","[","|","[","-1",",","-1",",","-1","]","|","[","8",",","9",",","7","]",",","[","0",",","1",",","2","]",",","|","[","-1",",","-1",",","-1","]","|","[","7",",","8",",","10","]",",","[","1",",","2",",","3","]",",","|","[","-1",",","-1",",","-1","]","|","[","9",",","10",",","8","]",",","]",",","|","[","-1",",","-1",",","-1","]",",","|","[","11",",","10",",","9","]",",","[","|","[","-1",",","-1",",","-1","]",",","|","[","11",",","7",",","8","]",",","[","1",",","2",",","0","]",",","|","]",",","|","[","11",",","10",",","8","]",",","[","0",",","1",",","3","]",",","|","[","|","[","11",",","9",",","8","]",",","[","2",",","3",",","1","]",",","|","[","0",",","1",",","2","]",",","|","]",")","[","4",",","3",",","2","]",",","|","[","1",",","2",",","3","]",",","|","[","4",",","0",",","1","]",",","|","[","-1",",","-1",",","-1","]",",","|","[","4",",","3",",","1","]",",","|","[","-1",",","-1",",","-1","]",",","|","[","4",",","2",",","1","]",",","|","[","-1",",","-1",",","-1","]",",","|","]",",","|","[","-1",",","-1",",","-1","]",",","|","]",")","|","[","-1",",","-1",",","-1","]",",","|","|","]",",","|","|","[","|","|","[","1",",","2",",","0","]",",","|","|","[","0",",","1",",","3","]",",","|","|","[","2",",","3",",","1","]",",","|","|","[","4",",","3",",","2","]",",","|","|","[","4",",","0",",","1","]",",","|","|","[","4",",","3",",","1","]",",","|","|","[","4",",","2",",","1","]",",","|","|","]","|","|","]",")","|","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-","Auxiliary","variables","for","packed","representation","Name","|","Size","|","Example","from","above","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-|","--","--","--","--","--","--","--","--","--","--","-|","--","--","--","--","--","--","--","--","--","--","--","-","|","|","verts_packed_to_mesh_idx","|","size","=","(","sum","(","V_n",")",")","|","tensor","(","[","|","|","0",",","0",",","0",",","1",",","1",",","1",",","|","|","1",",","2",",","2",",","2",",","2",",","2","|","|",")","]","|","|","size","=","(","12",")","|","|","mesh_to_verts_packed_first_idx","|","size","=","(","N",")","|","tensor","(","[","0",",","3",",","7","]",")","|","|","size","=","(","3",")","|","|","num_verts_per_mesh","|","size","=","(","N",")","|","tensor","(","[","3",",","4",",","5","]",")","|","|","size","=","(","3",")","|","|","faces_packed_to_mesh_idx","|","size","=","(","sum","(","F_n",")",")","|","tensor","(","[","|","|","0",",","1",",","1",",","2",",","2",",","2",",","|","|","2",",","2",",","2",",","2","|","|",")","]","|","|","size","=","(","10",")","|","|","mesh_to_faces_packed_first_idx","|","size","=","(","N",")","|","tensor","(","[","0",",","1",",","3","]",")","|","|","size","=","(","3",")","|","|","num_faces_per_mesh","|","size","=","(","N",")","|","tensor","(","[","1",",","2",",","7","]",")","|","|","size","=","(","3",")","|","|","verts_padded_to_packed_idx","|","size","=","(","sum","(","V_n",")",")","|","tensor","(","[","|","|","0",",","1",",","2",",","5",",","6",",","7",",","|","|","8",",","10",",","11",",","12",",","13",",","|","|","14","|","|",")","]","|","|","size","=","(","12",")","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-","#","SPHINX","IGNORE","From","the","faces",",","edges","are","computed","and","have","packed","and","padded","representations","with","auxiliary","variables",".","E_n","=","[","[","E_1","]",",","...",",","[","E_N","]","]","where","E_1",",","...",",","E_N","are","the","number","of","unique","edges","in","each","mesh",".","Total","number","of","unique","edges","=","sum","(","E_n",")","#","SPHINX","IGNORE","Name","|","Size","|","Example","from","above","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-|","--","--","--","--","--","--","--","--","--","--","--","--","-|","--","--","--","--","--","--","--","--","--","--","--","|","|","edges_packed","|","size","=","(","sum","(","E_n",")",",","2",")","|","tensor","(","[","|","|","[","0",",","1","]",",","|","|","[","0",",","2","]",",","|","|","[","1",",","2","]",",","|","|","...","|","|","[","10",",","11","]",",","|","|",")","]","|","|","size","=","(","18",",","2",")","|","|","num_edges_per_mesh","|","size","=","(","N",")","|","tensor","(","[","3",",","5",",","10","]",")","|","|","size","=","(","3",")","|","|","edges_packed_to_mesh_idx","|","size","=","(","sum","(","E_n",")",")","|","tensor","(","[","|","|","0",",","0",",","0",",","|","|",".",".",".","|","|","2",",","2",",","2","|","|","]",")","|","|","size","=","(","18",")","|","|","faces_packed_to_edges_packed","|","size","=","(","sum","(","F_n",")",",","3",")","|","tensor","(","[","|","|","[","2",",","1",",","0","]",",","|","|","[","5",",","4",",","3","]",",","|","|",".",".",".","|","|","[","12",",","14",",","16","]",",","|","|","]",")","|","|","size","=","(","10",",","3",")","|","|","mesh_to_edges_packed_first_idx","|","size","=","(","N",")","|","tensor","(","[","0",",","3",",","8","]",")","|","|","size","=","(","3",")","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","#","SPHINX","IGNORE"]
docstr: Split a batch of meshes into a batch of submeshes.
  
  The return value is a Meshes object representing
      [mesh restricted to only faces indexed by selected_faces
      for mesh, selected_faces_list in zip(self, face_indices)
      for faces in selected_faces_list]
  
  Args:
    face_indices:
      Let the original mesh have verts_list() of length N.
      Can be either
        - List of lists of LongTensors. The n-th element is a list of length
        num_submeshes_n (empty lists are allowed). The k-th element of the n-th
        sublist is a LongTensor of length num_faces_submesh_n_k.
        - List of LongTensors. The n-th element is a (possibly empty) LongTensor
          of shape (num_submeshes_n, num_faces_n).
        - A LongTensor of shape (N, num_submeshes_per_mesh, num_faces_per_submesh)
          where all meshes in the batch will have the same number of submeshes.
          This will result in an output Meshes object with batch size equal to
          N * num_submeshes_per_mesh.
  
  Returns:
    Meshes object of length `sum(len(ids) for ids in face_indices)`.
  
  Example 1:
  
  If `meshes` has batch size 1, and `face_indices` is a 1D LongTensor,
  then `meshes.submeshes([[face_indices]]) and
  `meshes.submeshes(face_indices[None, None])` both produce a Meshes of length 1,
  containing a single submesh with a subset of `meshes`' faces, whose indices are
  specified by `face_indices`.
  
  Example 2:
  
  Take a Meshes object `cubes` with 4 meshes, each a translated cube. Then:
      * len(cubes) is 4, len(cubes.verts_list()) is 4, len(cubes.faces_list()) 4,
      * [cube_verts.size for cube_verts in cubes.verts_list()] is [8, 8, 8, 8],
      * [cube_faces.size for cube_faces in cubes.faces_list()] if [6, 6, 6, 6],
  
  Now let front_facet, top_and_bottom, all_facets be LongTensors of
  sizes (2), (4), and (12), each picking up a number of facets of a cube by
  specifying the appropriate triangular faces.
  
  Then let `subcubes = cubes.submeshes([[front_facet, top_and_bottom], [],
                                        [all_facets], []])`.
      * len(subcubes) is 3.
      * subcubes[0] is the front facet of the cube contained in cubes[0].
      * subcubes[1] is a mesh containing the (disconnected) top and bottom facets
        of cubes[0].
      * subcubes[2] is cubes[2].
      * There are no submeshes of cubes[1] and cubes[3] in subcubes.
      * subcubes[0] and subcubes[1] are not watertight. subcubes[2] is.
code: def submeshes(
      self,
      face_indices: Union[
          List[List[torch.LongTensor]],
          List[torch.LongTensor],
          torch.LongTensor,
      ],
  ) -> "Meshes":
      """
      Split a batch of meshes into a batch of submeshes.
  
      The return value is a Meshes object representing
          [mesh restricted to only faces indexed by selected_faces
          for mesh, selected_faces_list in zip(self, face_indices)
          for faces in selected_faces_list]
  
      Args:
        face_indices:
          Let the original mesh have verts_list() of length N.
          Can be either
            - List of lists of LongTensors. The n-th element is a list of length
            num_submeshes_n (empty lists are allowed). The k-th element of the n-th
            sublist is a LongTensor of length num_faces_submesh_n_k.
            - List of LongTensors. The n-th element is a (possibly empty) LongTensor
              of shape (num_submeshes_n, num_faces_n).
            - A LongTensor of shape (N, num_submeshes_per_mesh, num_faces_per_submesh)
              where all meshes in the batch will have the same number of submeshes.
              This will result in an output Meshes object with batch size equal to
              N * num_submeshes_per_mesh.
  
      Returns:
        Meshes object of length `sum(len(ids) for ids in face_indices)`.
  
      Example 1:
  
      If `meshes` has batch size 1, and `face_indices` is a 1D LongTensor,
      then `meshes.submeshes([[face_indices]]) and
      `meshes.submeshes(face_indices[None, None])` both produce a Meshes of length 1,
      containing a single submesh with a subset of `meshes`' faces, whose indices are
      specified by `face_indices`.
  
      Example 2:
  
      Take a Meshes object `cubes` with 4 meshes, each a translated cube. Then:
          * len(cubes) is 4, len(cubes.verts_list()) is 4, len(cubes.faces_list()) 4,
          * [cube_verts.size for cube_verts in cubes.verts_list()] is [8, 8, 8, 8],
          * [cube_faces.size for cube_faces in cubes.faces_list()] if [6, 6, 6, 6],
  
      Now let front_facet, top_and_bottom, all_facets be LongTensors of
      sizes (2), (4), and (12), each picking up a number of facets of a cube by
      specifying the appropriate triangular faces.
  
      Then let `subcubes = cubes.submeshes([[front_facet, top_and_bottom], [],
                                            [all_facets], []])`.
          * len(subcubes) is 3.
          * subcubes[0] is the front facet of the cube contained in cubes[0].
          * subcubes[1] is a mesh containing the (disconnected) top and bottom facets
            of cubes[0].
          * subcubes[2] is cubes[2].
          * There are no submeshes of cubes[1] and cubes[3] in subcubes.
          * subcubes[0] and subcubes[1] are not watertight. subcubes[2] is.
      """
      if len(face_indices) != len(self):
          raise ValueError(
              "You must specify exactly one set of submeshes"
              " for each mesh in this Meshes object."
          )
  
      sub_verts = []
      sub_verts_ids = []
      sub_faces = []
  
      for face_ids_per_mesh, faces, verts in zip(
          face_indices, self.faces_list(), self.verts_list()
      ):
          sub_verts_ids.append([])
          for submesh_face_ids in face_ids_per_mesh:
              faces_to_keep = faces[submesh_face_ids]
  
              # Say we are keeping two faces from a mesh with six vertices:
              # faces_to_keep = [[0, 6, 4],
              #                  [0, 2, 6]]
              # Then we want verts_to_keep to contain only vertices [0, 2, 4, 6]:
              vertex_ids_to_keep = torch.unique(
                  faces_to_keep, sorted=True
              )
              sub_verts.append(verts[vertex_ids_to_keep])
              sub_verts_ids[-1].append(vertex_ids_to_keep)
  
              # Now, convert faces_to_keep to use the new vertex ids.
              # In our example, instead of
              # [[0, 6, 4],
              #  [0, 2, 6]]
              # we want faces_to_keep to be
              # [[0, 3, 2],
              #  [0, 1, 3]],
              # as each point id got reduced to its sort rank.
              _, ids_of_unique_ids_in_sorted = torch.unique(
                  faces_to_keep, return_inverse=True
              )
              sub_faces.append(ids_of_unique_ids_in_sorted)
  
      return self.__class__(
          verts=sub_verts,
          faces=sub_faces,
          textures=(
              self.textures.submeshes(sub_verts_ids, face_indices)
              if self.textures
              else None
          ),
      )
  
imports: from typing import List, Union
  import torch
  from ..common.datatypes import Device, make_device
  from .None import utils
label_desc: Use image node_id 54 for calling the Meshes obj's underlying member method code with example usage: obj.submeshes(face_indices) and returns: self