code: def test_model_internal():
      model = get_model()
  
      assert (
          model._device == torch.device("cuda")
          if torch.cuda.is_available()
          else torch.device("cpu")
      )
  
      box_predictor = model._model.roi_heads.box_predictor
      assert isinstance(box_predictor, FastRCNNPredictor)
      assert box_predictor.cls_score.out_features == 4
  
      assert model._classes == [
          "__background__",
          "test1",
          "test2",
          "test3",
      ]
      assert model._int_mapping["test1"] == 1
  
      # _int_mapping should give the right index of each class
      for k in model._int_mapping:
          assert model._classes[model._int_mapping[k]] == k
  
file_path: detecto/detecto/tests/test_core.py
imports: import torch
  from detecto.core import *
  from detecto.utils import read_image
  from .helpers import get_dataset, get_image, get_model, empty_predictor
  from torchvision import transforms
  from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
label_desc: Use image node_id 4 for calling a global function with example usage: test_model_internal() without return types