def from_indexed_dataset(self, dataset,
                              indices: List[int]=None, chunksize=100,
                              shuffle_indices: bool = False):
        """Read dataset from an indexable dataset.
        See https://docs.ffcv.io/writing_datasets.html#indexable-dataset for sample usage.

        Parameters
        ----------
        dataset: Indexable
            An indexable object that implements `__getitem__` and `__len__`.
        indices : List[int]
            Use a subset of the dataset specified by indices.
        chunksize : int
            Size of chunks processed by each worker during conversion.
        shuffle_indices : bool
            Shuffle order of the dataset.
        """
        # If the user didn't specify an order we just add samples
        # sequentially
        if indices is None:
            indices = np.arange(len(dataset))

        if shuffle_indices:
            np.random.shuffle(indices)

        # We add indices to the indices so that workers know where
        # to write in the metadata array
        indices: List[int] = list(enumerate(indices))

        self._write_common(len(indices), chunks(indices, chunksize),
                           worker_job_indexed_dataset, (dataset, ))
Read dataset from an indexable dataset.
        See https://docs.ffcv.io/writing_datasets.html#indexable-dataset for sample usage.

        Parameters
        ----------
        dataset: Indexable
            An indexable object that implements `__getitem__` and `__len__`.
        indices : List[int]
            Use a subset of the dataset specified by indices.
        chunksize : int
            Size of chunks processed by each worker during conversion.
        shuffle_indices : bool
            Shuffle order of the dataset.
        
ffcv/writer.py