code: def test_exception(self, device, dtype):
      with pytest.raises(TypeError):
          assert kornia.color.rgb_to_yuv420([0.0])
  
      with pytest.raises(ValueError):
          img = torch.ones(1, 1, device=device, dtype=dtype)
          assert kornia.color.rgb_to_yuv420(img)
  
      with pytest.raises(ValueError):
          img = torch.ones(2, 1, 1, device=device, dtype=dtype)
          assert kornia.color.rgb_to_yuv420(img)
  
      # dimensionality test
      with pytest.raises(ValueError):
          img = torch.ones(3, 2, 1, device=device, dtype=dtype)
          assert kornia.color.rgb_to_yuv420(img)
  
      # dimensionality test
      with pytest.raises(ValueError):
          img = torch.ones(3, 1, 2, device=device, dtype=dtype)
          assert kornia.color.rgb_to_yuv420(img)
  
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  from kornia.testing import BaseTester
label_desc: Use image node_id 3 for calling the TestRgbToYuv420 obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types