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: If any of the input_names have tokens or seq_tokens, add the length
  of those tokens to dummy_input
docstr_tok: ["If","any","of","the","input_names","have","tokens","or","seq_tokens",",","add","the","length","of","those","tokens","to","dummy_input"]
code: def _add_feature_lengths(
      cls, input_names: List[str], dummy_model_input: List
  ):
      """If any of the input_names have tokens or seq_tokens, add the length
      of those tokens to dummy_input
      """
      if "tokens_vals" in input_names:
          dummy_model_input.append(
              torch.tensor([1, 1], dtype=torch.long)
          )  # token lengths
          input_names.append("tokens_lens")
      if "seq_tokens_vals" in input_names:
          dummy_model_input.append(
              torch.tensor([1, 1], dtype=torch.long)
          )  # seq lengths
          input_names.append("seq_tokens_lens")
  
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 10 for calling the ModelExporter obj's underlying member method code with example usage: obj._add_feature_lengths(cls, input_names, dummy_model_input) without return types