class_docstr: Make a detectron2 model traceable with Caffe2 operators.
  This class creates a traceable version of a detectron2 model which:
  
  1. Rewrite parts of the model using ops in Caffe2. Note that some ops do
     not have GPU implementation in Caffe2.
  2. Remove post-processing and only produce raw layer outputs
  
  After making a traceable model, the class provide methods to export such a
  model to different deployment formats.
  Exported graph produced by this class take two input tensors:
  
  1. (1, C, H, W) float "data" which is an image (usually in [0, 255]).
     (H, W) often has to be padded to multiple of 32 (depend on the model
     architecture).
  2. 1x3 float "im_info", each row of which is (height, width, 1.0).
     Height and width are true image shapes before padding.
  
  The class currently only supports models using builtin meta architectures.
  Batch inference is not supported, and contributions are welcome.
docstr: Export the model to a ``torch.jit.TracedModule`` by tracing.
  The returned object can be saved to a file by ``.save()``.
  
  Returns:
      torch.jit.TracedModule: a torch TracedModule
docstr_tok: ["Export","the","model","to","a","``","torch.jit.TracedModule","``","by","tracing",".","The","returned","object","can","be","saved","to","a","file","by","``",".save","(",")","``",".","Returns",":","torch.jit.TracedModule",":","a","torch","TracedModule"]
code: def export_torchscript(self):
      """
      Export the model to a ``torch.jit.TracedModule`` by tracing.
      The returned object can be saved to a file by ``.save()``.
  
      Returns:
          torch.jit.TracedModule: a torch TracedModule
      """
      logger = logging.getLogger(__name__)
      logger.info("Tracing the model with torch.jit.trace ...")
      with torch.no_grad():
          return torch.jit.trace(
              self.traceable_model, (self.traceable_inputs,)
          )
  
imports: import copy
  import logging
  import os
  import torch
  from caffe2.proto import caffe2_pb2
  from torch import nn
  from detectron2.config import CfgNode
  from detectron2.utils.file_io import PathManager
  from .caffe2_inference import ProtobufDetectionModel
  from .caffe2_modeling import META_ARCH_CAFFE2_EXPORT_TYPE_MAP, convert_batched_inputs_to_c2_format
  from .shared import get_pb_arg_vali, get_pb_arg_vals, save_graph
label_desc: Use image node_id 4 for calling the Caffe2Tracer obj's underlying member method code with example usage: obj.export_torchscript() and returns: torch