class_docstr: Data collator used for permutation language modeling.
  
  - collates batches of tensors, honoring their tokenizer's pad_token
  - preprocesses batches for permutation language modeling with procedures specific to XLNet
class_docstr_tok: ["Data","collator","used","for","permutation","language","modeling",".","-","collates","batches","of","tensors",",","honoring","their","tokenizer","'s","pad_token","-","preprocesses","batches","for","permutation","language","modeling","with","procedures","specific","to","XLNet"]
code: def torch_call(
      self, examples: List[Union[List[int], Any, Dict[str, Any]]]
  ) -> Dict[str, Any]:
      if isinstance(examples[0], Mapping):
          examples = [e["input_ids"] for e in examples]
      batch = _torch_collate_batch(examples, self.tokenizer)
      (
          inputs,
          perm_mask,
          target_mapping,
          labels,
      ) = self.torch_mask_tokens(batch)
      return {
          "input_ids": inputs,
          "perm_mask": perm_mask,
          "target_mapping": target_mapping,
          "labels": labels,
      }
  
imports: import random
  import warnings
  from collections.abc import Mapping
  from dataclasses import dataclass
  from random import randint
  from typing import Any, Callable, Dict, List, NewType, Optional, Tuple, Union
  import numpy
  from ..models.bert import BertTokenizer, BertTokenizerFast
  from ..tokenization_utils_base import PreTrainedTokenizerBase
  from ..utils import PaddingStrategy
label_desc: Use image node_id 1 for calling the DataCollatorForPermutationLanguageModeling obj's underlying member method code with example usage: obj.torch_call(examples) and returns: dict