code: def test_gradcheck(self, device, dtype):
      # input data
      window_size = 3
      img1 = torch.rand(1, 1, 5, 4, device=device, dtype=dtype)
      img2 = torch.rand(1, 1, 5, 4, device=device, dtype=dtype)
  
      # evaluate function gradient
      img1 = utils.tensor_to_gradcheck_var(img1)  # to var
      img2 = utils.tensor_to_gradcheck_var(img2)  # to var
  
      # TODO: review method since it needs `nondet_tol` in cuda sometimes.
      assert gradcheck(
          kornia.losses.ssim_loss,
          (img1, img2, window_size),
          raise_exception=True,
          nondet_tol=1e-8,
          fast_mode=True,
      )
  
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  import kornia.testing
  from kornia.testing import BaseTester, assert_close
label_desc: Use image node_id 4 for calling the TestSSIMLoss obj's underlying member method code with example usage: obj.test_gradcheck(device, dtype) without return types