code: def __init__(self, cfg: DummyMaskedLMConfig):
      super().__init__(cfg)
  
      self.dictionary = Dictionary()
      for i in range(cfg.dict_size):
          self.dictionary.add_symbol("word{}".format(i))
      logger.info("dictionary: {} types".format(len(self.dictionary)))
      # add mask token
      self.mask_idx = self.dictionary.add_symbol("<mask>")
      self.dictionary.pad_to_multiple_(
          8
      )  # often faster if divisible by 8
  
      mask_idx = 0
      pad_idx = 1
      seq = torch.arange(cfg.tokens_per_sample) + pad_idx + 1
      mask = torch.arange(2, cfg.tokens_per_sample, 7)  # ~15%
      src = seq.clone()
      src[mask] = mask_idx
      tgt = torch.full_like(seq, pad_idx)
      tgt[mask] = seq[mask]
  
      self.dummy_src = src
      self.dummy_tgt = tgt
  
file_path: fairseq/fairseq/benchmark/dummy_masked_lm.py
imports: import logging
  from dataclasses import dataclass, field
  from typing import Optional
  import torch
  from omegaconf import II
  from .dummy_dataset import DummyDataset
  from fairseq.data import Dictionary
  from fairseq.dataclass import FairseqDataclass
  from fairseq.tasks import FairseqTask, register_task
label_desc: Use image node_id 1 to create a new DummyMaskedLMTask object from inherited base classes: FairseqTask with example: obj = DummyMaskedLMTask(cfg)