read_file

paddle.fluid.layers.read_file(reader)[source]

Execute the given reader and get data via it.

A reader is also a Variable. It can be a raw reader generated by fluid.layers.open_files() or a decorated one generated by fluid.layers.double_buffer() .

Parameters

reader (Variable) – The reader to execute.

Returns

Data read from the given reader.

Return type

Tuple[Variable]

Examples

import paddle.fluid as fluid
reader = fluid.layers.py_reader(capacity=64,
                                shapes=[(-1, 1, 28, 28), (-1, 1)],
                                dtypes=['float32', 'int64'])
image, label = fluid.layers.read_file(reader)