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

Function RealMain

tensorflow/compiler/xla/tools/convert_computation.cc:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace tools {
34
35void RealMain(const string& mode, const string& path) {
36 HloSnapshot module;
37 tensorflow::Env* env = tensorflow::Env::Default();
38 if (mode == "txt2bin") {
39 TF_CHECK_OK(tensorflow::ReadTextProto(env, path, &module));
40 TF_CHECK_OK(tensorflow::WriteBinaryProto(env, path, module));
41 } else if (mode == "bin2txt") {
42 TF_CHECK_OK(tensorflow::ReadBinaryProto(env, path, &module));
43 string out;
44 tensorflow::protobuf::TextFormat::PrintToString(module, &out);
45 fprintf(stdout, "%s", out.c_str());
46 } else {
47 LOG(QFATAL) << "unknown mode for computation conversion: " << mode;
48 }
49}
50
51} // namespace tools
52} // namespace xla

Callers 1

mainFunction · 0.70

Calls 5

DefaultFunction · 0.85
ReadTextProtoFunction · 0.85
WriteBinaryProtoFunction · 0.85
ReadBinaryProtoFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected