code: def test_exception(self):
      model = Sam.from_config(SamConfig("mobile_sam"))
  
      with pytest.raises(TypeError) as errinfo:
          inpt = torch.rand(3, 1, 2)
          model(inpt, [], False)
      assert (
          "shape must be [['B', '3', 'H', 'W']]. Got torch.Size([3, 1, 2])"
          in str(errinfo)
      )
  
      with pytest.raises(Exception) as errinfo:
          inpt = torch.rand(2, 3, 1, 2)
          model(inpt, [{}], False)
      assert (
          "The number of images (`B`) should match with the length of prompts!"
          in str(errinfo)
      )
  
file_path: kornia/test/contrib/models/test_sam.py
imports: import pytest
  import torch
  from kornia.contrib.models.sam import Sam, SamConfig
  from kornia.core import pad
  from kornia.testing import BaseTester
label_desc: Use image node_id 3 for calling the TestSam obj's underlying member method code with example usage: obj.test_exception() without return types