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

Function DumpProtoToDirectory

tensorflow/compiler/xla/protobuf_util.cc:41–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41Status DumpProtoToDirectory(const tensorflow::protobuf::Message& message,
42 const string& directory, const string& file_name,
43 string* full_path) {
44 tensorflow::Env* env = tensorflow::Env::Default();
45 TF_RETURN_IF_ERROR(env->RecursivelyCreateDir(directory));
46 string safe_file_name = SanitizeFileName(file_name) + ".pb";
47 string full_path_impl;
48 if (!full_path) {
49 full_path = &full_path_impl;
50 }
51 *full_path = tensorflow::io::JoinPath(directory, safe_file_name);
52 return tensorflow::WriteBinaryProto(env, *full_path, message);
53}
54
55} // namespace protobuf_util
56} // namespace xla

Callers

nothing calls this directly

Calls 5

DefaultFunction · 0.85
SanitizeFileNameFunction · 0.85
WriteBinaryProtoFunction · 0.85
JoinPathFunction · 0.50
RecursivelyCreateDirMethod · 0.45

Tested by

no test coverage detected