code: def test_interpolate_attributes(self):
      verts = torch.randn((4, 3), dtype=torch.float32)
      faces = torch.tensor([[2, 1, 0], [3, 1, 0]], dtype=torch.int64)
      vert_tex = torch.tensor(
          [[0, 1, 0], [0, 1, 1], [1, 1, 0], [1, 1, 1]],
          dtype=torch.float32,
      )
      tex = TexturesVertex(verts_features=vert_tex[None, :])
      mesh = Meshes(verts=[verts], faces=[faces], textures=tex)
      pix_to_face = torch.tensor([0, 1], dtype=torch.int64).view(
          1, 1, 1, 2
      )
      barycentric_coords = torch.tensor(
          [[0.5, 0.3, 0.2], [0.3, 0.6, 0.1]], dtype=torch.float32
      ).view(1, 1, 1, 2, -1)
      expected_vals = torch.tensor(
          [[0.5, 1.0, 0.3], [0.3, 1.0, 0.9]], dtype=torch.float32
      ).view(1, 1, 1, 2, -1)
      fragments = Fragments(
          pix_to_face=pix_to_face,
          bary_coords=barycentric_coords,
          zbuf=torch.ones_like(pix_to_face),
          dists=torch.ones_like(pix_to_face),
      )
  
      verts_features_packed = mesh.textures.verts_features_packed()
      faces_verts_features = verts_features_packed[mesh.faces_packed()]
  
      texels = interpolate_face_attributes(
          fragments.pix_to_face,
          fragments.bary_coords,
          faces_verts_features,
      )
      self.assertTrue(torch.allclose(texels, expected_vals[None, :]))
  
file_path: pytorch3d/tests/test_interpolate_face_attributes.py
imports: import unittest
  import torch
  from pytorch3d.ops.interp_face_attrs import interpolate_face_attributes, interpolate_face_attributes_python
  from pytorch3d.renderer.mesh import TexturesVertex
  from pytorch3d.renderer.mesh.rasterizer import Fragments
  from pytorch3d.structures import Meshes
  from .common_testing import get_random_cuda_device, TestCaseMixin
label_desc: Use image node_id 5 for calling the TestInterpolateFaceAttributes obj's underlying member method code with example usage: obj.test_interpolate_attributes() without return types