code: def test_dynamo(self, device, torch_optimizer):
      dtype = torch.float32
      img = torch.rand(1, 3, 128, 75, device=device, dtype=dtype)
  
      op = Sam.from_config(SamConfig("vit_b"))
      op = op.to(device=device, dtype=dtype)
  
      op_optimized = torch_optimizer(op)
  
      img = _pad_rb(img, op.image_encoder.img_size)
  
      expected = op(img, [{}], False)
      actual = op_optimized(img, [{}], False)
  
      self.assert_close(expected[0].logits, actual[0].logits)
      self.assert_close(expected[0].scores, actual[0].scores)
  
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 7 for calling the TestSam obj's underlying member method code with example usage: obj.test_dynamo(device, torch_optimizer) without return types