code: def test_exception(self, device, dtype):
      with pytest.raises(TypeError):
          assert kornia.color.rgb_to_raw([0.0], kornia.color.raw.CFA.RG)
  
      with pytest.raises(ValueError):
          img = torch.ones(1, 1, device=device, dtype=dtype)
          assert kornia.color.rgb_to_raw(img, kornia.color.raw.CFA.BG)
  
imports: import warnings
  import pytest
  import torch
  from packaging import version
  from torch.autograd import gradcheck
  import kornia
  from kornia.testing import BaseTester, assert_close
label_desc: Use image node_id 3 for calling the TestRgbToRaw obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types