docstr: Call the pack_rectangles function, which we want to test,
  and return its outputs.
  Additionally makes some sanity checks on the output.
docstr_tok: ["Call","the","pack_rectangles","function",",","which","we","want","to","test",",","and","return","its","outputs",".","Additionally","makes","some","sanity","checks","on","the","output","."]
code: def wrap_pack(self, sizes):
      """
      Call the pack_rectangles function, which we want to test,
      and return its outputs.
      Additionally makes some sanity checks on the output.
      """
      res = pack_rectangles(sizes)
      total = res.total_size
      self.assertGreaterEqual(total[0], 0)
      self.assertGreaterEqual(total[1], 0)
      mask = torch.zeros(total, dtype=torch.bool)
      seen_x_bound = False
      seen_y_bound = False
      for (in_x, in_y), (out_x, out_y, flipped, is_first) in zip(
          sizes, res.locations
      ):
          self.assertTrue(is_first)
          self.assertGreaterEqual(out_x, 0)
          self.assertGreaterEqual(out_y, 0)
          placed_x, placed_y = (in_y, in_x) if flipped else (in_x, in_y)
          upper_x = placed_x + out_x
          upper_y = placed_y + out_y
          self.assertGreaterEqual(total[0], upper_x)
          if total[0] == upper_x:
              seen_x_bound = True
          self.assertGreaterEqual(total[1], upper_y)
          if total[1] == upper_y:
              seen_y_bound = True
          already_taken = torch.sum(mask[out_x:upper_x, out_y:upper_y])
          self.assertEqual(already_taken, 0)
          mask[out_x:upper_x, out_y:upper_y] = 1
      self.assertTrue(seen_x_bound)
      self.assertTrue(seen_y_bound)
  
      self.assertTrue(
          torch.all(torch.sum(mask, dim=0, dtype=torch.int32) > 0)
      )
      self.assertTrue(
          torch.all(torch.sum(mask, dim=1, dtype=torch.int32) > 0)
      )
      return res
  
imports: import unittest
  import torch
  import torch.nn.functional
  from pytorch3d.renderer.mesh.rasterizer import Fragments
  from pytorch3d.renderer.mesh.textures import _list_to_padded_wrapper, TexturesAtlas, TexturesUV, TexturesVertex
  from pytorch3d.renderer.mesh.utils import pack_rectangles, pack_unique_rectangles, Rectangle
  from pytorch3d.structures import list_to_packed, Meshes, packed_to_list
  from .common_testing import TestCaseMixin
  from .test_meshes import init_mesh
label_desc: Use image node_id 2 for calling the TestRectanglePacking obj's underlying member method code with example usage: obj.wrap_pack(sizes) and returns: res