code: def test_fpn_scriptability(self):
      cfg = model_zoo.get_config(
          "Misc/scratch_mask_rcnn_R_50_FPN_3x_gn.yaml"
      )
      bb = build_resnet_fpn_backbone(cfg, ShapeSpec(channels=3))
      bb_s = torch.jit.script(bb)
  
      inp = torch.rand(2, 3, 128, 128)
      out1 = bb(inp)["p5"]
      out2 = bb_s(inp)["p5"]
      self.assertTrue(torch.allclose(out1, out2))
  
file_path: detectron2/tests/modeling/test_backbone.py
imports: import unittest
  import torch
  import detectron2.export.torchscript
  from detectron2 import model_zoo
  from detectron2.config import get_cfg
  from detectron2.layers import ShapeSpec
  from detectron2.modeling.backbone import build_resnet_backbone
  from detectron2.modeling.backbone.fpn import build_resnet_fpn_backbone
label_desc: Use image node_id 2 for calling the TestBackBone obj's underlying member method code with example usage: obj.test_fpn_scriptability() without return types