code: def get_tri_center_normal(tris: torch.Tensor) -> torch.Tensor:
      """
      Returns the center and normal of triangles
      Args:
          tris: tensor of shape (T, 3, 3)
      Returns:
          center: tensor of shape (T, 3)
          normal: tensor of shape (T, 3)
      """
      add_dim0 = False
      if tris.ndim == 2:
          tris = tris.unsqueeze(0)
          add_dim0 = True
  
      ctr = tris.mean(1)  # (T, 3)
      normals = torch.zeros_like(ctr)
  
      v0, v1, v2 = tris.unbind(1)  # 3 x (T, 3)
  
      # unvectorized solution
      T = tris.shape[0]
      for t in range(T):
          ns = torch.zeros((3, 3), device=tris.device)
          ns[0] = torch.cross(v0[t] - ctr[t], v1[t] - ctr[t], dim=-1)
          ns[1] = torch.cross(v0[t] - ctr[t], v2[t] - ctr[t], dim=-1)
          ns[2] = torch.cross(v1[t] - ctr[t], v2[t] - ctr[t], dim=-1)
  
          i = torch.norm(ns, dim=-1).argmax()
          normals[t] = ns[i]
  
      if add_dim0:
          ctr = ctr[0]
          normals = normals[0]
      normals = F.normalize(normals, dim=-1)
      return ctr, normals
  
imports: import pickle
  import random
  import unittest
  from typing import List, Tuple, Union
  import torch
  import torch.nn.functional
  from pytorch3d.io import save_obj
  from pytorch3d.ops.iou_box3d import _box_planes, _box_triangles, box3d_overlap
  from pytorch3d.transforms.rotation_conversions import random_rotation
  from .common_testing import get_random_cuda_device, get_tests_dir, TestCaseMixin
label_desc: Use image node_id 3 for calling a global function with example usage: get_tri_center_normal(tris) and returns: ctr,  normals