code: def test_script(self, model, input_param, input_shape):
      try:
          idx = int(self.id().split("test_script_")[-1])
      except BaseException:
          idx = 0
      idx %= 3
      # test whether support torchscript
      data = torch.randn(input_shape)
      backbone = model(**input_param)
      if idx == 0:
          test_script_save(backbone, data)
          return
      feature_extractor = resnet_fpn_feature_extractor(
          backbone=backbone,
          spatial_dims=input_param["spatial_dims"],
          pretrained_backbone=input_param["pretrained"],
          trainable_backbone_layers=None,
          returned_layers=[1, 2],
      )
      if idx == 1:
          test_script_save(feature_extractor, data)
          return
      net = RetinaNet(
          spatial_dims=input_param["spatial_dims"],
          num_classes=input_param["num_classes"],
          num_anchors=num_anchors,
          feature_extractor=feature_extractor,
          size_divisible=32,
      )
      if idx == 2:
          test_script_save(net, data)
  
file_path: MONAI/tests/test_retinanet.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.apps.detection.networks.retinanet_network import RetinaNet, resnet_fpn_feature_extractor
  from monai.networks import eval_mode
  from monai.networks.nets import resnet10, resnet18, resnet34, resnet50, resnet101, resnet152, resnet200
  from monai.utils import ensure_tuple, optional_import
  from tests.utils import SkipIfBeforePyTorchVersion, skip_if_quick, test_onnx_save, test_script_save
label_desc: Use image node_id 2 for calling the TestRetinaNet obj's underlying member method code with example usage: obj.test_script(model, input_param, input_shape) without return types