# Dataset Source: https://www.tensorplay.cn/docs/generated/tensorplay.utils.data.Dataset.html ```python class tensorplay.utils.data.Dataset ``` An abstract class representing a [Dataset](#tensorplay.utils.data.Dataset). All datasets that represent a map from keys to data samples should subclass it. All subclasses should overwrite __getitem__(), supporting fetching a data sample for a given key. Subclasses could also optionally overwrite __len__(), which is expected to return the size of the dataset by many [Sampler](/docs/generated/tensorplay.utils.data.Sampler.html#tensorplay.utils.data.Sampler) implementations and the default options of [DataLoader](/docs/generated/tensorplay.utils.data.DataLoader.html#tensorplay.utils.data.DataLoader). > **Note** > > DataLoader by default constructs an index sampler that yields integral indices. To make it work with a map-style dataset with non-integral indices/keys, a custom sampler must be provided.