code: def test_dump_IR_tracing(self):
      cfg = get_cfg()
      cfg.MODEL.RESNETS.DEPTH = 18
      cfg.MODEL.RESNETS.RES2_OUT_CHANNELS = 64
  
      class Mod(nn.Module):
          def forward(self, x):
              return tuple(self.m(x).values())
  
      model = Mod()
      model.m = build_backbone(cfg)
      model.eval()
  
      with torch.no_grad():
          ts_model = torch.jit.trace(
              model, (torch.rand(2, 3, 224, 224),)
          )
  
      with tempfile.TemporaryDirectory(prefix="detectron2_test") as d:
          dump_torchscript_IR(ts_model, d)
          # check that the files are created
          for name in [
              "model_ts_code",
              "model_ts_IR",
              "model_ts_IR_inlined",
              "model",
          ]:
              fname = os.path.join(d, name + ".txt")
              self.assertTrue(os.stat(fname).st_size > 0, fname)
  
imports: import copy
  import glob
  import json
  import os
  import random
  import tempfile
  import unittest
  import zipfile
  import torch
  from torch import Tensor, nn
  from detectron2 import model_zoo
  from detectron2.config import get_cfg
  from detectron2.config.instantiate import dump_dataclass, instantiate
  from detectron2.export import dump_torchscript_IR, scripting_with_instances
  from detectron2.export.flatten import TracingAdapter, flatten_to_tuple
  from detectron2.export.torchscript_patch import patch_builtin_len
  from detectron2.layers import ShapeSpec
  from detectron2.modeling import build_backbone
  from detectron2.modeling.postprocessing import detector_postprocess
  from detectron2.modeling.roi_heads import KRCNNConvDeconvUpsampleHead
  from detectron2.structures import Boxes, Instances
  from detectron2.utils.env import TORCH_VERSION
  from detectron2.utils.testing import assert_instances_allclose, convert_scripted_instances, get_sample_coco_image, random_boxes, reload_script_model, skipIfOnCPUCI
label_desc: Use image node_id 1 for calling the TestTorchscriptUtils obj's underlying member method code with example usage: obj.test_dump_IR_tracing() and returns: tuple