class_docstr: Dataset which shuffles a given dataset.
  
  `ShuffleDataset` is a sub-class of `ResampleDataset` provided for
  convenience. It samples uniformly from the given `dataset` with, or without
  `replacement`. The chosen partition can be redrawn by calling `resample()`
  
  If `replacement` is `true`, then the specified `size` may be larger than
  the underlying `dataset`.
  If `size` is not provided, then the new dataset size will be equal to the
  underlying `dataset` size.
  
  Purpose: the easiest way to shuffle a dataset!
  
  Args:
      dataset (Dataset): Dataset to be shuffled.
      size (int, optional): Desired size of the shuffled dataset. If
          `replacement` is `true`, then can be larger than the `len(dataset)`.
          By default, the new dataset will have the same size as `dataset`.
      replacement (bool, optional): True if uniform sampling is to be done
          with replacement. False otherwise. Defaults to false.
  
  Raises:
      ValueError: If `size` is larger than the size of the underlying dataset
          and `replacement` is False.
class_docstr_tok: ["Dataset","which","shuffles","a","given","dataset",".","`","ShuffleDataset","`","is","a","sub-class","of","`","ResampleDataset","`","provided","for","convenience",".","It","samples","uniformly","from","the","given","`","dataset","`","with",",","or","without","`","replacement","`",".","The","chosen","partition","can","be","redrawn","by","calling","`","resample","(",")","`","If","`","replacement","`","is","`","true","`",",","then","the","specified","`","size","`","may","be","larger","than","the","underlying","`","dataset","`",".","If","`","size","`","is","not","provided",",","then","the","new","dataset","size","will","be","equal","to","the","underlying","`","dataset","`","size",".","Purpose",":","the","easiest","way","to","shuffle","a","dataset","!","Args",":","dataset","(","Dataset",")",":","Dataset","to","be","shuffled",".","size","(","int",",","optional",")",":","Desired","size","of","the","shuffled","dataset",".","If","`","replacement","`","is","`","true","`",",","then","can","be","larger","than","the","`","len","(","dataset",")","`",".","By","default",",","the","new","dataset","will","have","the","same","size","as","`","dataset","`",".","replacement","(","bool",",","optional",")",":","True","if","uniform","sampling","is","to","be","done","with","replacement",".","False","otherwise",".","Defaults","to","false",".","Raises",":","ValueError",":","If","`","size","`","is","larger","than","the","size","of","the","underlying","dataset","and","`","replacement","`","is","False","."]
code: def __init__(self, dataset, size=None, replacement=False):
      if size and not replacement and size > len(dataset):
          raise ValueError(
              "size cannot be larger than underlying dataset \
                      size when sampling without replacement"
          )
  
      super(ShuffleDataset, self).__init__(
          dataset, lambda dataset, idx: self.perm[idx], size
      )
      self.replacement = replacement
      self.resample()
  
imports: from .resampledataset import ResampleDataset
  import torch
label_desc: Use image node_id 1 to create a new ShuffleDataset object from inherited base classes: ResampleDataset with example: obj = ShuffleDataset(dataset, size, replacement)