docstr: Test moving all the tensors in the points renderer to a new device.
docstr_tok: ["Test","moving","all","the","tensors","in","the","points","renderer","to","a","new","device","."]
code: def test_points_renderer_to(self):
      """
      Test moving all the tensors in the points renderer to a new device.
      """
  
      device1 = torch.device("cpu")
  
      R, T = look_at_view_transform(1500, 0.0, 0.0)
  
      raster_settings = PointsRasterizationSettings(
          image_size=256, radius=0.001, points_per_pixel=1
      )
      cameras = FoVPerspectiveCameras(
          device=device1, R=R, T=T, aspect_ratio=1.0, fov=60.0, zfar=100
      )
      rasterizer = PointsRasterizer(
          cameras=cameras, raster_settings=raster_settings
      )
  
      renderer = PointsRenderer(
          rasterizer=rasterizer, compositor=AlphaCompositor()
      )
  
      mesh = ico_sphere(2, device1)
      verts_padded = mesh.verts_padded()
      pointclouds = Pointclouds(
          points=verts_padded, features=torch.randn_like(verts_padded)
      )
      self._check_points_renderer_props_on_device(renderer, device1)
  
      # Test rendering on cpu
      output_images = renderer(pointclouds)
      self.assertEqual(output_images.device, device1)
  
      # Move renderer and pointclouds to another device and re render
      device2 = torch.device("cuda:0")
      renderer = renderer.to(device2)
      pointclouds = pointclouds.to(device2)
      self._check_points_renderer_props_on_device(renderer, device2)
      output_images = renderer(pointclouds)
      self.assertEqual(output_images.device, device2)
  
imports: import unittest
  import torch
  import torch.nn
  from pytorch3d.renderer import AlphaCompositor, BlendParams, HardGouraudShader, Materials, MeshRasterizer, MeshRenderer, PointLights, PointsRasterizationSettings, PointsRasterizer, PointsRenderer, RasterizationSettings, SoftPhongShader, SplatterPhongShader, TexturesVertex
  from pytorch3d.renderer.cameras import FoVPerspectiveCameras, look_at_view_transform
  from pytorch3d.renderer.opengl import MeshRasterizerOpenGL
  from pytorch3d.structures import Meshes, Pointclouds
  from pytorch3d.utils.ico_sphere import ico_sphere
  from .common_testing import TestCaseMixin
label_desc: Use image node_id 2 for calling the TestRenderPointsMultiGPU obj's underlying member method code with example usage: obj.test_points_renderer_to() without return types