code: def test_scale(self):
      def naive_scale(cloud, scale):
          if not torch.is_tensor(scale):
              scale = torch.full(
                  (len(cloud),), scale, device=cloud.device
              )
          new_points_list = [
              scale[i] * points.clone()
              for (i, points) in enumerate(cloud.points_list())
          ]
          return Pointclouds(
              new_points_list,
              cloud.normals_list(),
              cloud.features_list(),
          )
  
      N = 5
      for test in ["tensor", "scalar"]:
          for force in (False, True):
              clouds = self.init_cloud(N, 100, 10)
              if force:
                  clouds._compute_packed(refresh=True)
                  clouds._compute_padded()
                  clouds.padded_to_packed_idx()
              if test == "tensor":
                  scales = torch.rand(N)
              elif test == "scalar":
                  scales = torch.rand(1)[0].item()
              new_clouds_naive = naive_scale(clouds, scales)
              new_clouds = clouds.scale(scales)
              for i in range(N):
                  if test == "tensor":
                      self.assertClose(
                          scales[i] * clouds.points_list()[i],
                          new_clouds.points_list()[i],
                      )
                  else:
                      self.assertClose(
                          scales * clouds.points_list()[i],
                          new_clouds.points_list()[i],
                      )
                  self.assertClose(
                      clouds.normals_list()[i],
                      new_clouds_naive.normals_list()[i],
                  )
                  self.assertClose(
                      clouds.features_list()[i],
                      new_clouds_naive.features_list()[i],
                  )
              self.assertCloudsEqual(new_clouds, new_clouds_naive)
  
imports: import itertools
  import random
  import unittest
  import numpy
  import torch
  from pytorch3d.structures import utils
  from pytorch3d.structures.pointclouds import join_pointclouds_as_batch, join_pointclouds_as_scene, Pointclouds
  from .common_testing import TestCaseMixin
label_desc: Use image node_id 15 for calling the TestPointclouds obj's underlying member method code with example usage: obj.test_scale() and returns: Pointclouds