docstr: Wire up tokenize(), numberize() and tensorize() functions for data
  processing.
docstr_tok: ["Wire","up","tokenize","(",")",",","numberize","(",")","and","tensorize","(",")","functions","for","data","processing","."]
code: def forward(
      self, inputs: ScriptBatchInput
  ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
      """
      Wire up tokenize(), numberize() and tensorize() functions for data
      processing.
      """
      batch_size: int = self.batch_size(inputs)
      row_size: int = self.row_size(inputs)
      languages: Optional[List[List[str]]] = inputs.languages
      if languages is None:
          languages = [[self.default_language] * row_size] * batch_size
  
      tokens_2d: List[List[int]] = []
      segment_labels_2d: List[List[int]] = []
      seq_lens_1d: List[int] = []
      positions_2d: List[List[int]] = []
  
      for idx in range(self.batch_size(inputs)):
          tokens: List[List[Tuple[str, int, int]]] = self.tokenize(
              self.get_texts_by_index(inputs.texts, idx),
              self.get_tokens_by_index(inputs.tokens, idx),
          )
          language_ids: List[int] = [
              self.language_vocab.idx.get(
                  languages[idx][0], self.language_vocab.unk_idx
              )
          ] * row_size
  
          numberized: Tuple[
              List[int], List[int], int, List[int]
          ] = self.numberize(tokens, language_ids)
          tokens_2d.append(numberized[0])
          segment_labels_2d.append(numberized[1])
          seq_lens_1d.append(numberized[2])
          positions_2d.append(numberized[3])
  
      return self.tensorize(
          tokens_2d, segment_labels_2d, seq_lens_1d, positions_2d
      )
  
imports: from typing import Any, Dict, List, Optional, Tuple
  import torch
  from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDictionary
  from pytext.common.constants import SpecialTokens
  from pytext.config.component import ComponentType, create_component
  from pytext.data.bert_tensorizer import BERTTensorizerBase, BERTTensorizerBaseScriptImpl, build_fairseq_vocab
  from pytext.data.tokenizers import Tokenizer
  from pytext.data.utils import Vocabulary
  from pytext.data.xlm_constants import LANG2ID_15
  from pytext.torchscript.utils import ScriptBatchInput
  from pytext.torchscript.vocab import ScriptVocabulary
  from pytext.utils.file_io import PathManager
  from pytext.utils.lazy import lazy_property
label_desc: Use image node_id 4 for calling the XLMTensorizerScriptImpl obj's underlying member method code with example usage: obj.forward(inputs) and returns: self