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

Method DumpEventProtoToFile

tensorflow/core/debug/debug_io_utils.cc:621–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621Status DebugFileIO::DumpEventProtoToFile(const Event& event_proto,
622 const string& dir_name,
623 const string& file_name) {
624 Env* env(Env::Default());
625
626 Status s = RecursiveCreateDir(env, dir_name);
627 if (!s.ok()) {
628 return Status(error::FAILED_PRECONDITION,
629 strings::StrCat("Failed to create directory ", dir_name,
630 ", due to: ", s.error_message()));
631 }
632
633 const string file_path = io::JoinPath(dir_name, file_name);
634
635 string event_str;
636 event_proto.SerializeToString(&event_str);
637
638 std::unique_ptr<WritableFile> f = nullptr;
639 TF_CHECK_OK(env->NewWritableFile(file_path, &f));
640 f->Append(event_str).IgnoreError();
641 TF_CHECK_OK(f->Close());
642
643 return Status::OK();
644}
645
646Status DebugFileIO::DumpTensorToEventFile(const DebugNodeKey& debug_node_key,
647 const Tensor& tensor,

Callers

nothing calls this directly

Calls 9

StatusClass · 0.50
StrCatFunction · 0.50
JoinPathFunction · 0.50
okMethod · 0.45
SerializeToStringMethod · 0.45
NewWritableFileMethod · 0.45
IgnoreErrorMethod · 0.45
AppendMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected