code: def test_gradcheck(self, device):
      img = torch.rand(2, 1, 256, 256, device=device)
      img = utils.tensor_to_gradcheck_var(img)  # to var
      sold2 = SOLD2(pretrained=False).to(img.device, img.dtype)
  
      def proxy_forward(x):
          return sold2.forward(x)["dense_desc"]
  
      assert gradcheck(
          proxy_forward,
          (img,),
          eps=1e-4,
          atol=1e-4,
          raise_exception=True,
      )
  
file_path: kornia/test/feature/test_sold2.py
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia.testing
  from kornia.feature.sold2 import SOLD2, SOLD2_detector
  from kornia.testing import assert_close
label_desc: Use image node_id 2 for calling the TestSOLD2 obj's underlying member method code with example usage: obj.test_gradcheck(device) and returns: sold2