code: def test_boxes_to_tensor(self, shape, device, dtype):
      # Hexahedron with randomized vertices to reflect possible transforms.
      box = Boxes3D(
          torch.as_tensor(
              [
                  [
                      [2, 2, 1],
                      [1, 2, 1],
                      [2, 3, 2],
                      [1, 3, 2],
                      [2, 2, 2],
                      [1, 3, 1],
                      [2, 3, 1],
                      [1, 2, 2],
                  ]
              ],
              device=device,
              dtype=dtype,
          ).view(*shape[:-1], 8, 3)
      )
  
      expected_box_xyzxyz = torch.as_tensor(
          [[1, 2, 1, 3, 4, 3]], device=device, dtype=dtype
      ).view(*shape)
      expected_box_xyzxyz_plus = torch.as_tensor(
          [[1, 2, 1, 2, 3, 2]], device=device, dtype=dtype
      ).view(*shape)
      expected_box_xyzwhd = torch.as_tensor(
          [[1, 2, 1, 2, 2, 2]], device=device, dtype=dtype
      ).view(*shape)
      expected_vertices = torch.as_tensor(
          [
              [
                  [1, 2, 1],
                  [3, 2, 1],
                  [3, 4, 1],
                  [1, 4, 1],
                  [1, 2, 3],
                  [3, 2, 3],
                  [3, 4, 3],
                  [1, 4, 3],
              ]
          ],  # Front  # Back
          device=device,
          dtype=dtype,
      ).view(*shape[:-1], 8, 3)
      expected_vertices_plus = torch.as_tensor(
          [
              [
                  [1, 2, 1],
                  [2, 2, 1],
                  [2, 3, 1],
                  [1, 3, 1],
                  [1, 2, 2],
                  [2, 2, 2],
                  [2, 3, 2],
                  [1, 3, 2],
              ]
          ],  # Front  # Back
          device=device,
          dtype=dtype,
      ).view(*shape[:-1], 8, 3)
  
      kornia_xyzxyz = box.to_tensor(mode="xyzxyz")
      kornia_xyzxyz_plus = box.to_tensor(mode="xyzxyz_plus")
      kornia_xyzwhd = box.to_tensor(mode="xyzwhd")
      kornia_vertices = box.to_tensor(mode="vertices")
      kornia_vertices_plus = box.to_tensor(mode="vertices_plus")
  
      assert kornia_xyzxyz.shape == expected_box_xyzxyz.shape
      assert_close(kornia_xyzxyz, expected_box_xyzxyz)
  
      assert kornia_xyzxyz_plus.shape == expected_box_xyzxyz_plus.shape
      assert_close(kornia_xyzxyz_plus, expected_box_xyzxyz_plus)
  
      assert kornia_xyzwhd.shape == expected_box_xyzwhd.shape
      assert_close(kornia_xyzwhd, expected_box_xyzwhd)
  
      assert kornia_vertices.shape == expected_vertices.shape
      assert_close(kornia_vertices, expected_vertices)
  
      assert kornia_vertices_plus.shape == expected_vertices_plus.shape
      assert_close(kornia_vertices_plus, expected_vertices_plus)
  
imports: from functools import partial
  import pytest
  import torch
  from kornia.geometry.boxes import Boxes, Boxes3D
  from kornia.testing import assert_close, gradcheck, tensor_to_gradcheck_var
label_desc: Use image node_id 6 for calling the TestBbox3D obj's underlying member method code with example usage: obj.test_boxes_to_tensor(shape, device, dtype) without return types