code: def test_gradcheck(self, hd, shape, device):
      num_classes = 3
      logits = torch.rand(2, num_classes, *shape, device=device)
      labels = (
          torch.rand(2, 1, *shape, device=device) * (num_classes - 1)
      ).long()
      loss = hd(k=2)
  
      logits = utils.tensor_to_gradcheck_var(logits)  # to var
      assert gradcheck(
          loss, (logits, labels), raise_exception=True, fast_mode=True
      )
  
file_path: kornia/test/losses/test_hd.py
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  import kornia.testing
  from kornia.testing import assert_close
label_desc: Use image node_id 6 for calling the TestHausdorffLoss obj's underlying member method code with example usage: obj.test_gradcheck(hd, shape, device) without return types