class_docstr: <a id="map_style_dataset"></a>
  
  ## Map Style Dataset
  
  This converts an [`IterableDataset`](https://pytorch.org/docs/stable/data.html#torch.utils.data.IterableDataset)
  to a [map-style dataset](https://pytorch.org/docs/stable/data.html#map-style-datasets)
  so that we can shuffle the dataset.
  
  *This only works when the dataset size is small and can be held in memory.*
code: def __init__(self, dataset: IterableDataset):
      # Load the data to memory
      self.data = [d for d in dataset]
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/utils/__init__.py
imports: import copy
  from torch.utils.data import Dataset, IterableDataset
  from labml_helpers.module import M, TypedModuleList
label_desc: Use image node_id 1 to create a new MapStyleDataset object from inherited base classes: Dataset with example: obj = MapStyleDataset(dataset)