cache

paddle.fluid.io.cache(reader)[source]

Cache the reader data into memory.

Be careful that this method may take long time to process, and consume lots of memory. reader() would only call once.

Parameters

reader (generator) – a reader object which yields data each time.

Returns

a decorated reader object which yields data from cached memory.

Return type

generator