Apache Singa
A General Distributed Deep Learning Library
Public Member Functions | Protected Member Functions | List of all members
singa::io::BinFileWriter Class Reference

BinFile stores training/validation/test tuples. More...

#include <writer.h>

Inheritance diagram for singa::io::BinFileWriter:
Inheritance graph
[legend]
Collaboration diagram for singa::io::BinFileWriter:
Collaboration graph
[legend]

Public Member Functions

bool Open (const std::string &path, Mode mode) override
 
bool Open (const std::string &path, Mode mode, int capacity)
 user defines capacity More...
 
void Close () override
 
bool Write (const std::string &key, const std::string &value) override
 override; override; More...
 
void Flush () override
 
std::string path ()
 return path to binary file
 
- Public Member Functions inherited from singa::io::Writer
virtual ~Writer ()
 In case that users forget to call Close() to release resources, e.g., memory, you can release them here. More...
 

Protected Member Functions

bool OpenFile ()
 Open a file with path_ and initialize buf_.
 

Detailed Description

BinFile stores training/validation/test tuples.

Each tuple is encoded as [magic_word, key_len, key, val_len, val]:

Member Function Documentation

◆ Close()

void singa::io::BinFileWriter::Close ( )
overridevirtual

Implements singa::io::Writer.

◆ Flush()

void singa::io::BinFileWriter::Flush ( )
overridevirtual

Implements singa::io::Writer.

◆ Open() [1/2]

bool singa::io::BinFileWriter::Open ( const std::string &  path,
Mode  mode 
)
overridevirtual

Implements singa::io::Writer.

◆ Open() [2/2]

bool singa::io::BinFileWriter::Open ( const std::string &  path,
Mode  mode,
int  capacity 
)

user defines capacity

user defines capacity

◆ Write()

bool singa::io::BinFileWriter::Write ( const std::string &  key,
const std::string &  value 
)
overridevirtual

override; override;

override; override;

Implements singa::io::Writer.


The documentation for this class was generated from the following file: