class_docstr: Retro's customized GPT dataset.
  
  Args:
      indexed_dataset (MMapIndexedDataset): The MMapIndexedDataset around which to build the
      MegatronDataset
  
      indexed_indices (numpy.ndarray): The set of the documents indices to expose
  
      num_samples (int): The number of samples to draw from the indexed dataset
  
      index_split (Split): The indexed_indices Split
  
      config (MultiSplitGPTDatasetConfig): The Retro-specific container for all config sourced parameters
class_docstr_tok: ["Retro","'s","customized","GPT","dataset",".","Args",":","indexed_dataset","(","MMapIndexedDataset",")",":","The","MMapIndexedDataset","around","which","to","build","the","MegatronDataset","indexed_indices","(","numpy.ndarray",")",":","The","set","of","the","documents","indices","to","expose","num_samples","(","int",")",":","The","number","of","samples","to","draw","from","the","indexed","dataset","index_split","(","Split",")",":","The","indexed_indices","Split","config","(","MultiSplitGPTDatasetConfig",")",":","The","Retro-specific","container","for","all","config","sourced","parameters"]
docstr: Abstract method implementation
  
  Args:
      idx (int): The index into the dataset
  
  Returns:
      Dict[str, numpy.ndarray]: The text ids and (optionally) the document ids wrapped in a
      dictionary
docstr_tok: ["Abstract","method","implementation","Args",":","idx","(","int",")",":","The","index","into","the","dataset","Returns",":","Dict","[","str",",","numpy.ndarray","]",":","The","text","ids","and","(","optionally",")","the","document","ids","wrapped","in","a","dictionary"]
code: def __getitem__(self, idx: int) -> Dict[str, numpy.ndarray]:
      """Abstract method implementation
  
      Args:
          idx (int): The index into the dataset
  
      Returns:
          Dict[str, numpy.ndarray]: The text ids and (optionally) the document ids wrapped in a
          dictionary
      """
      text, document_ids = self._query_document_sample_shuffle_indices(
          idx
      )
      if self.config.return_document_ids:
          return {"text": text, "document_ids": document_ids}
      else:
          return {"text": text}
  
file_path: megatron-lm/tools/retro/query/multi_split_gpt_dataset.py
imports: import logging
  from dataclasses import dataclass
  from typing import Dict, List
  import numpy
  import torch
  from megatron.core.datasets.blended_megatron_dataset_config import convert_split_vector_to_split_matrix, parse_and_normalize_split
  from megatron.core.datasets.gpt_dataset import GPTDataset, GPTDatasetConfig
  from megatron.core.datasets.indexed_dataset import MMapIndexedDataset
  from megatron.core.datasets.utils import Split, log_single_rank
label_desc: Use image node_id 2 for calling the MultiSplitGPTDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: dict, dict