| 39 | } |
| 40 | |
| 41 | Status 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 |
nothing calls this directly
no test coverage detected