code: def test_exception(self):
      img = torch.rand(3, 15, 15)
      image_to_string(img)
  
      img = torch.rand(3, 15, 15)
      image_to_string(img, max_width=12)
  
      with pytest.raises(TypeError) as errinfo:
          img = torch.rand(1, 3, 15, 15)
          image_to_string(img)
      assert (
          "shape must be [['C', 'H', 'W']]. Got torch.Size([1, 3, 15, 15])"
          in str(errinfo)
      )
  
      with pytest.raises(ValueError) as errinfo:
          img = torch.rand(3, 15, 15) * 10
          image_to_string(img)
      assert "Invalid image value range. Expect [0, 1] but got" in str(
          errinfo
      )
  
      with pytest.raises(RuntimeError):
          print_image([img])
  
imports: import pytest
  import torch
  from kornia.utils import image_to_string, print_image
label_desc: Use image node_id 2 for calling the TestImageToString obj's underlying member method code with example usage: obj.test_exception() without return types