MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / New

Method New

tensorflow/python/lib/io/py_record_writer.cc:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28PyRecordWriter::PyRecordWriter() {}
29
30PyRecordWriter* PyRecordWriter::New(const string& filename,
31 const io::RecordWriterOptions& options,
32 TF_Status* out_status) {
33 std::unique_ptr<WritableFile> file;
34 Status s = Env::Default()->NewWritableFile(filename, &file);
35 if (!s.ok()) {
36 Set_TF_Status_from_Status(out_status, s);
37 return nullptr;
38 }
39 PyRecordWriter* writer = new PyRecordWriter;
40 writer->file_ = std::move(file);
41 writer->writer_.reset(new RecordWriter(writer->file_.get(), options));
42 return writer;
43}
44
45PyRecordWriter::~PyRecordWriter() {
46 // Writer depends on file during close for zlib flush, so destruct first.

Callers

nothing calls this directly

Calls 6

DefaultFunction · 0.85
NewWritableFileMethod · 0.45
okMethod · 0.45
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected