xmap_readers(mapper, reader, process_num, buffer_size, order=False)
Use multi-threads to map samples from reader by a mapper defined by user.
mapper (callable) – a function to map the data from reader.
reader (callable) – a data reader which yields the data.
process_num (int) – thread number to handle original sample.
buffer_size (int) – size of the queue to read data in.
order (bool) – whether to keep the data order from original reader. Default False.
a decorated reader with data mapping.
- Return type