code: def test_nan_rgb_to_hls(self, device, dtype):
      if dtype == torch.float16:
          pytest.skip("not work for half-precision")
  
      if device != torch.device("cpu") and version.parse(
          torch.__version__
      ) < version.parse("1.7.0"):
          warnings.warn(
              "This test is not compatible with pytorch < 1.7.0. This message will be removed as soon as we do not "
              "support pytorch 1.6.0. `torch.max()` have a problem in pytorch < 1.7.0 then we cannot get the correct "
              "result. https://github.com/pytorch/pytorch/issues/41781",
              DeprecationWarning,
              stacklevel=2,
          )
          return
      data = torch.ones(2, 3, 5, 5, device=device, dtype=dtype)
  
      # OpenCV
      expected = torch.cat(
          [
              torch.zeros(2, 1, 5, 5, device=device, dtype=dtype),
              torch.ones(2, 1, 5, 5, device=device, dtype=dtype),
              torch.zeros(2, 1, 5, 5, device=device, dtype=dtype),
          ],
          dim=1,
      )
      self.assert_close(kornia.color.rgb_to_hls(data), expected)
  
imports: import math
  import warnings
  import pytest
  import torch
  from packaging import version
  from torch.autograd import gradcheck
  import kornia
  from kornia.testing import BaseTester
label_desc: Use image node_id 5 for calling the TestRgbToHls obj's underlying member method code with example usage: obj.test_nan_rgb_to_hls(device, dtype) without return types