code: def test_inference_object_detection_head(self):
      model = YolosForObjectDetection.from_pretrained(
          "hustvl/yolos-small"
      ).to(torch_device)
  
      feature_extractor = self.default_feature_extractor
      image = prepare_img()
      inputs = feature_extractor(images=image, return_tensors="pt").to(
          torch_device
      )
  
      # forward pass
      with torch.no_grad():
          outputs = model(inputs.pixel_values)
  
      # verify the logits
      expected_shape = torch.Size((1, 100, 92))
      self.assertEqual(outputs.logits.shape, expected_shape)
  
      expected_slice_logits = torch.tensor(
          [
              [-24.0248, -10.3024, -14.8290],
              [-42.0392, -16.8200, -27.4334],
              [-27.2743, -11.8154, -18.7148],
          ],
          device=torch_device,
      )
      expected_slice_boxes = torch.tensor(
          [
              [0.2559, 0.5455, 0.4706],
              [0.2989, 0.7279, 0.1875],
              [0.7732, 0.4017, 0.4462],
          ],
          device=torch_device,
      )
      self.assertTrue(
          torch.allclose(
              outputs.logits[0, :3, :3],
              expected_slice_logits,
              atol=1e-4,
          )
      )
      self.assertTrue(
          torch.allclose(
              outputs.pred_boxes[0, :3, :3],
              expected_slice_boxes,
              atol=1e-4,
          )
      )
  
imports: import inspect
  import unittest
  from transformers import YolosConfig
  from transformers.testing_utils import require_torch, require_vision, slow, torch_device
  from transformers.utils import cached_property, is_torch_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor
label_desc: Use image node_id 2 for calling the YolosModelIntegrationTest obj's underlying member method code with example usage: obj.test_inference_object_detection_head() without return types