Apache Singa
A General Distributed Deep Learning Library
|
General Writer that provides functions for writing tuples. More...
#include <writer.h>
Public Member Functions | |
virtual | ~Writer () |
In case that users forget to call Close() to release resources, e.g., memory, you can release them here. More... | |
virtual bool | Open (const std::string &path, Mode mode)=0 |
Open a file. More... | |
virtual void | Close ()=0 |
Release resources. | |
virtual bool | Write (const std::string &key, const std::string &value)=0 |
Write a key-value tuple. More... | |
virtual void | Flush ()=0 |
Flush writing buffer if it has. | |
General Writer that provides functions for writing tuples.
Subclasses implement the functions for a specific data storage, e.g., CSV file, HDFS, image folder, leveldb, lmdb, etc.
|
inlinevirtual |
In case that users forget to call Close() to release resources, e.g., memory, you can release them here.
|
pure virtual |
Open a file.
path is the path to the disk BinFile, it can be
Implemented in singa::io::TextFileWriter, and singa::io::BinFileWriter.
|
pure virtual |
Write a key-value tuple.
return true if success, otherwise false.
Implemented in singa::io::TextFileWriter, and singa::io::BinFileWriter.