code: def DISABLED_test_doc_export_to_caffe2_with_logits(
      self,
      num_doc_classes,
      test_num_words,
      test_num_dict_feat,
      num_predictions,
      test_num_chars,
  ):
      for config in DOC_CONFIGS_WITH_EXPORT_LOGITS:
          config = self._get_config(
              DocumentClassificationTask.Config, config
          )
          metadata = self._get_metadata(num_doc_classes, 0)
          py_model = create_model(
              config.model, config.features, metadata
          )
          exporter = create_exporter(
              config.exporter, config.features, config.labels, metadata
          )
  
          with tempfile.NamedTemporaryFile(
              delete=False, suffix=".predictor"
          ) as pred_file:
              print(pred_file.name)
              output_names = exporter.export_to_caffe2(
                  py_model, pred_file.name
              )
              workspace.ResetWorkspace()
          pred_net = pe.prepare_prediction_net(
              pred_file.name, CAFFE2_DB_TYPE
          )
  
          for _i in range(num_predictions):
              pred_net = pe.prepare_prediction_net(
                  pred_file.name, CAFFE2_DB_TYPE
              )
              test_inputs = self._get_rand_input(
                  config.features,
                  BATCH_SIZE,
                  W_VOCAB_SIZE,
                  DICT_VOCAB_SIZE,
                  CHAR_VOCAB_SIZE,
                  test_num_words,
                  test_num_dict_feat,
                  test_num_chars,
              )
              self._feed_c2_input(
                  workspace,
                  test_inputs,
                  exporter.input_names,
                  metadata.feature_itos_map,
              )
              workspace.RunNetOnce(pred_net)
              c2_out = [
                  list(workspace.FetchBlob(o_name))
                  for o_name in output_names
              ]
  
              py_model.eval()
              py_outs = py_model(*test_inputs)
              np.testing.assert_array_almost_equal(
                  py_outs.view(-1).detach().numpy(),
                  np.array(c2_out[-1]).flatten(),
              )
  
              # Do log_softmax since we do that before exporting predictor nets
              py_outs = F.log_softmax(py_outs, 1)
              np.testing.assert_array_almost_equal(
                  py_outs.view(-1).detach().numpy(),
                  np.array(c2_out[:-1]).flatten(),
              )
  
imports: import json
  import operator
  import tempfile
  from collections import Counter
  from distutils.version import LooseVersion
  import caffe2.python.hypothesis_test_util
  import caffe2.python.predictor.predictor_exporter
  import hypothesis.strategies
  import numpy
  import torch
  import torch.nn.functional
  import torchtext
  from caffe2.python import workspace
  from hypothesis import given, settings
  from pytext.builtin_task import DocumentClassificationTask, IntentSlotTask, SeqNNTask, WordTaggingTask
  from pytext.common.constants import DatasetFieldName, SpecialTokens
  from pytext.config import config_from_json
  from pytext.config.component import create_exporter, create_model
  from pytext.data import CommonMetadata
  from pytext.data.utils import Vocabulary
  from pytext.exporters.exporter import ModelExporter
  from pytext.fields import CharFeatureField, DictFeatureField, FieldMeta, SeqFeatureField, TextFeatureField
  from pytext.legacy.vocab import Vocab
  from pytext.task.new_task import _NewTask
  from pytext.utils.onnx import CAFFE2_DB_TYPE
label_desc: Use image node_id 2 for calling the ModelExporterTest obj's underlying member method code with example usage: obj.DISABLED_test_doc_export_to_caffe2_with_logits(num_doc_classes, test_num_words, test_num_dict_feat, num_predictions, test_num_chars) without return types