class_docstr: Model exporter exports a PyTorch model to Caffe2 model using ONNX
  
  Attributes:
      input_names (List[Str]): names of the input variables to model forward
          function, in a flattened way.
          e.g: forward(tokens, dict) where tokens is List[Tensor] and dict is
          a tuple of value and length: (List[Tensor], List[Tensor]) the
          input names should looks like ['token', 'dict_value', 'dict_length']
      dummy_model_input (Tuple[torch.Tensor]): dummy values to define the
          shape of input tensors, should exactly match the shape of the model
          forward function
      vocab_map (Dict[str, List[str]]): dict of input feature names
          to corresponding index_to_string array, e.g:
          ::
  
              {
                  "text": ["<UNK>", "W1", "W2", "W3", "W4", "W5", "W6", "W7", "W8"],
                  "dict": ["<UNK>", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8"]
              }
      output_names (List[Str]): names of output variables
docstr: Postprocess the model output, generate additional blobs for human readable
  prediction. By default it use export function of output layer from pytorch
  model to append additional operators to caffe2 net
  
  Args:
      init_net (caffe2.python.Net): caffe2 init net created by the current graph
      predict_net (caffe2.python.Net): caffe2 net created by the current graph
      workspace (caffe2.python.workspace): caffe2 current workspace
      output_names (List[str]): current output names of the caffe2 net
      py_model (Model): original pytorch model object
  
  Returns:
      result: list of blobs that will be added to the caffe2 model
      final_output_names: list of output names of the blobs to add
docstr_tok: ["Postprocess","the","model","output",",","generate","additional","blobs","for","human","readable","prediction",".","By","default","it","use","export","function","of","output","layer","from","pytorch","model","to","append","additional","operators","to","caffe2","net","Args",":","init_net","(","caffe2.python.Net",")",":","caffe2","init","net","created","by","the","current","graph","predict_net","(","caffe2.python.Net",")",":","caffe2","net","created","by","the","current","graph","workspace","(","caffe2.python.workspace",")",":","caffe2","current","workspace","output_names","(","List","[","str","]",")",":","current","output","names","of","the","caffe2","net","py_model","(","Model",")",":","original","pytorch","model","object","Returns",":","result",":","list","of","blobs","that","will","be","added","to","the","caffe2","model","final_output_names",":","list","of","output","names","of","the","blobs","to","add"]
code: def postprocess_output(
      self,
      init_net: core.Net,
      predict_net: core.Net,
      workspace: core.workspace,
      output_names: List[str],
      py_model,
  ):
      """
      Postprocess the model output, generate additional blobs for human readable
      prediction. By default it use export function of output layer from pytorch
      model to append additional operators to caffe2 net
  
      Args:
          init_net (caffe2.python.Net): caffe2 init net created by the current graph
          predict_net (caffe2.python.Net): caffe2 net created by the current graph
          workspace (caffe2.python.workspace): caffe2 current workspace
          output_names (List[str]): current output names of the caffe2 net
          py_model (Model): original pytorch model object
  
      Returns:
          result: list of blobs that will be added to the caffe2 model
          final_output_names: list of output names of the blobs to add
      """
      model_out = py_model(*self.dummy_model_input)
      res = py_model.output_layer.export_to_caffe2(
          workspace, init_net, predict_net, model_out, *output_names
      )
  
      # optionally include the last decoder layer of pytorch model
      final_output_names = [str(output) for output in res] + (
          output_names if self.config.export_logits else []
      )
  
      return res, final_output_names
  
imports: import tempfile
  from typing import Callable, Dict, List, Tuple, Union
  import torch
  from caffe2.python import core
  from caffe2.python.onnx.backend_rep import Caffe2Rep
  from pytext.config import ConfigBase
  from pytext.config.component import Component, ComponentType
  from pytext.config.field_config import FeatureConfig
  from pytext.data import CommonMetadata
  from pytext.fields import FieldMeta
  from pytext.utils import onnx
  from pytext.utils.file_io import PathManager
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 5 for calling the ModelExporter obj's underlying member method code with example usage: obj.postprocess_output(init_net, predict_net, workspace, output_names, py_model) and returns: res,  final_output_names