As seen in a previous example, datasets can iterate over files using the .list_files() static method. This method creates a dataset of string tensors, each containing the path of one of the listed files. Each file can then be opened using, for instance, tf.io.read_file() (tf.io contains file-related operations).
The tf.data API also provides some specific datasets to iterate over binary or text files. tf.data.TextLineDataset() can be used to read documents line by line (useful for some public datasets that are listing their image files and/or labels in text files); tf.data.experimental.CsvDataset() can parse CSV files and return their content line by line too.
tf.data.experimental does not ensure the same backward compatibility as other modules. By the time this book reaches our readers, methods may have been moved to tf.data.Dataset or simply removed (for methods that are temporary solutions to some TensorFlow limitations). We invite our readers to check the documentation...