code: def test_gradcheck(self, device):
      # Uncomment when enabling gradient checks
      # def apply_boxes_method(tensor: torch.Tensor, method: str, **kwargs):
      #     boxes = Boxes3D(tensor)
      #     result = getattr(boxes, method)(**kwargs)
      #     return result.data if isinstance(result, Boxes3D) else result
  
      t_boxes1 = torch.tensor(
          [
              [
                  [0.0, 1.0, 2.0],
                  [10, 1, 2],
                  [10, 21, 2],
                  [0, 21, 2],
                  [0, 1, 32],
                  [10, 1, 32],
                  [10, 21, 32],
                  [0, 21, 32],
              ]
          ],
          device=device,
      )
  
      t_boxes1 = tensor_to_gradcheck_var(t_boxes1)
      # Uncomment when enabling gradient checks
      # t_boxes2 = tensor_to_gradcheck_var(t_boxes1.detach().clone())
      # t_boxes3 = tensor_to_gradcheck_var(t_boxes1.detach().clone())
      # t_boxes4 = tensor_to_gradcheck_var(t_boxes1.detach().clone())
      t_boxes_xyzxyz = tensor_to_gradcheck_var(
          torch.tensor([[1.0, 3.0, 8.0, 5.0, 6.0, 12.0]])
      )
      t_boxes_xyzxyz1 = tensor_to_gradcheck_var(
          t_boxes_xyzxyz.detach().clone()
      )
  
      # Gradient checks for Boxes3D.to_tensor (and Boxes3D.get_boxes_shape) are disable since the is a bug
      # in their gradient. See https://github.com/kornia/kornia/issues/1396.
      # assert gradcheck(partial(apply_boxes_method, method='to_tensor'), (t_boxes2,), raise_exception=True)
      # assert gradcheck(
      #     partial(apply_boxes_method, method='to_tensor', mode='xyzxyz_plus'), (t_boxes3,), raise_exception=True
      # )
      # assert gradcheck(
      #     partial(apply_boxes_method, method='to_tensor', mode='vertices_plus'), (t_boxes4,), raise_exception=True
      # )
      # assert gradcheck(partial(apply_boxes_method, method='get_boxes_shape'), (t_boxes1,), raise_exception=True)
      gradcheck(
          lambda x: Boxes3D.from_tensor(x, mode="xyzxyz_plus").data,
          (t_boxes_xyzxyz,),
      )
      gradcheck(
          lambda x: Boxes3D.from_tensor(x, mode="xyzwhd").data,
          (t_boxes_xyzxyz1,),
      )
  
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 9 for calling the TestBbox3D obj's underlying member method code with example usage: obj.test_gradcheck(device) without return types