code: def face_to_tri(face: List[str]) -> Tensor:
      face_index = [
          [int(x) for x in line.strip().split()] for line in face
      ]
  
      triangle = torch.tensor(
          [line[1:] for line in face_index if line[0] == 3]
      )
      triangle = triangle.to(torch.int64)
  
      rect = torch.tensor(
          [line[1:] for line in face_index if line[0] == 4]
      )
      rect = rect.to(torch.int64)
  
      if rect.numel() > 0:
          first, second = rect[:, [0, 1, 2]], rect[:, [0, 2, 3]]
          return (
              torch.cat([triangle, first, second], dim=0)
              .t()
              .contiguous()
          )
  
      return triangle.t().contiguous()
  
file_path: pytorch_geometric/torch_geometric/io/off.py
imports: import re
  from typing import List
  import torch
  from torch import Tensor
  from torch._tensor_str import PRINT_OPTS, _tensor_str
  from torch_geometric.data import Data
  from torch_geometric.io import parse_txt_array
label_desc: Use image node_id 2 for calling a global function with example usage: face_to_tri(face) and returns: triangle, torch