def preprocess_dataset(dataset, labels):
start = time.time()<EOL>with mp.Pool() as pool:<EOL><INDENT>dataset = gluon.data.SimpleDataset(list(zip(dataset, labels)))<EOL>lengths = gluon.data.SimpleDataset(pool.map(get_length, dataset))<EOL><DEDENT>end = time.time()<EOL>logging.info('<STR_LIT>'<EOL>.format(end - start, len(dataset)))<EOL>return dataset, lengths<EOL>
Preprocess and prepare a dataset