class_docstr: A BlendableDataset implementation that uses less memory than the original implementation.
  Indices are computed algorithmically instead of storing them in memory.
  
  To test call: MemoryEfficientBlendableDataset.test_index_blending()
class_docstr_tok: ["A","BlendableDataset","implementation","that","uses","less","memory","than","the","original","implementation",".","Indices","are","computed","algorithmically","instead","of","storing","them","in","memory",".","To","test","call",":","MemoryEfficientBlendableDataset.test_index_blending","(",")"]
docstr: Returns ds index and sample index (within the ds) for the given index in the blendable dataset.
docstr_tok: ["Returns","ds","index","and","sample","index","(","within","the","ds",")","for","the","given","index","in","the","blendable","dataset","."]
code: def get_ds_sample_idx(self, idx):
      """Returns ds index and sample index (within the ds) for the given index in the blendable dataset."""
  
      bin = idx % self.weight_bins
      ds_idx = self.ds_index[bin]
      sample_idx = (
          self.ds_bias[bin]
          + (idx // self.weight_bins) * self.ds_index_size[ds_idx]
      ) % self.ds_size[ds_idx]
  
      return ds_idx, sample_idx
  
file_path: NeMo/nemo/collections/nlp/data/language_modeling/megatron/blendable_dataset.py
imports: import time
  import numpy
  import torch
  from nemo.utils import logging
  from nemo.utils.app_state import AppState
label_desc: Use image node_id 2 for calling the MemoryEfficientBlendableDataset obj's underlying member method code with example usage: obj.get_ds_sample_idx(idx) and returns: ds_idx,  sample_idx