code: def test_inference_semantic_segmentation(self):
      model = MobileViTForSemanticSegmentation.from_pretrained(
          "apple/deeplabv3-mobilevit-xx-small"
      )
      model = model.to(torch_device)
  
      feature_extractor = MobileViTFeatureExtractor.from_pretrained(
          "apple/deeplabv3-mobilevit-xx-small"
      )
  
      image = prepare_img()
      inputs = feature_extractor(images=image, return_tensors="pt").to(
          torch_device
      )
  
      # forward pass
      with torch.no_grad():
          outputs = model(**inputs)
      logits = outputs.logits
  
      # verify the logits
      expected_shape = torch.Size((1, 21, 32, 32))
      self.assertEqual(logits.shape, expected_shape)
  
      expected_slice = torch.tensor(
          [
              [
                  [6.9713, 6.9786, 7.2422],
                  [7.2893, 7.2825, 7.4446],
                  [7.6580, 7.8797, 7.9420],
              ],
              [
                  [-10.6869, -10.3250, -10.3471],
                  [-10.4228, -9.9868, -9.7132],
                  [-11.0405, -11.0221, -10.7318],
              ],
              [
                  [-3.3089, -2.8539, -2.6740],
                  [-3.2706, -2.5621, -2.5108],
                  [-3.2534, -2.6615, -2.6651],
              ],
          ],
          device=torch_device,
      )
  
      self.assertTrue(
          torch.allclose(
              logits[0, :3, :3, :3], expected_slice, atol=1e-4
          )
      )
  
imports: import inspect
  import unittest
  from transformers import MobileViTConfig
  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, ids_tensor
label_desc: Use image node_id 3 for calling the MobileViTModelIntegrationTest obj's underlying member method code with example usage: obj.test_inference_semantic_segmentation() without return types