code: def test_compare_to_expected(self):
      bbox_xywh_to_xyxy_expected = torch.LongTensor(
          [
              [[0, 0, 10, 20], [0, 0, 10, 20]],
              [[10, 20, 5, 1], [10, 20, 15, 21]],
              [[10, 20, 1, 1], [10, 20, 11, 21]],
              [[5, 4, 0, 1], [5, 4, 5, 5]],
          ]
      )
      for bbox_xywh, bbox_xyxy_expected in bbox_xywh_to_xyxy_expected:
          self.assertClose(
              bbox_xywh_to_xyxy(bbox_xywh), bbox_xyxy_expected
          )
          self.assertClose(
              bbox_xyxy_to_xywh(bbox_xyxy_expected), bbox_xywh
          )
  
      clamp_amnt = 3
      bbox_xywh_to_xyxy_clamped_expected = torch.LongTensor(
          [
              [[0, 0, 10, 20], [0, 0, 10, 20]],
              [[10, 20, 5, 1], [10, 20, 15, 20 + clamp_amnt]],
              [
                  [10, 20, 1, 1],
                  [10, 20, 10 + clamp_amnt, 20 + clamp_amnt],
              ],
              [[5, 4, 0, 1], [5, 4, 5 + clamp_amnt, 4 + clamp_amnt]],
          ]
      )
      for (
          bbox_xywh,
          bbox_xyxy_expected,
      ) in bbox_xywh_to_xyxy_clamped_expected:
          self.assertClose(
              bbox_xywh_to_xyxy(bbox_xywh, clamp_size=clamp_amnt),
              bbox_xyxy_expected,
          )
  
file_path: pytorch3d/tests/implicitron/test_bbox.py
imports: import unittest
  import numpy
  import torch
  from pytorch3d.implicitron.dataset.utils import bbox_xywh_to_xyxy, bbox_xyxy_to_xywh, clamp_box_to_image_bounds_and_round, crop_around_box, get_1d_bounds, get_bbox_from_mask, get_clamp_bbox, rescale_bbox, resize_image
  from tests.common_testing import TestCaseMixin
label_desc: Use image node_id 3 for calling the TestBBox obj's underlying member method code with example usage: obj.test_compare_to_expected() without return types