code: def test_verts_nan(self):
      num_verts = 30
      num_faces = 50
      for device in ["cpu", "cuda:0"]:
          for invalid in ["nan", "inf"]:
              verts = torch.rand(
                  (num_verts, 3), dtype=torch.float32, device=device
              )
              # randomly assign an invalid type
              verts[torch.randperm(num_verts)[:10]] = float(invalid)
              faces = torch.randint(
                  num_verts,
                  size=(num_faces, 3),
                  dtype=torch.int64,
                  device=device,
              )
              meshes = Meshes(verts=[verts], faces=[faces])
  
              with self.assertRaisesRegex(
                  ValueError, "Meshes contain nan or inf."
              ):
                  sample_points_from_meshes(
                      meshes, num_samples=100, return_normals=True
                  )
  
imports: import unittest
  import numpy
  import torch
  from PIL import Image
  from pytorch3d.io import load_objs_as_meshes
  from pytorch3d.ops import sample_points_from_meshes
  from pytorch3d.renderer import TexturesVertex
  from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_transform
  from pytorch3d.renderer.mesh.rasterize_meshes import barycentric_coordinates
  from pytorch3d.renderer.points import NormWeightedCompositor, PointsRasterizationSettings, PointsRasterizer, PointsRenderer
  from pytorch3d.structures import Meshes, Pointclouds
  from pytorch3d.utils.ico_sphere import ico_sphere
  from .common_testing import get_pytorch3d_dir, get_random_cuda_device, get_tests_dir, TestCaseMixin
label_desc: Use image node_id 6 for calling the TestSamplePoints obj's underlying member method code with example usage: obj.test_verts_nan() without return types