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

Function StringToBool

tensorflow/core/profiler/internal/tfprof_utils.cc:99–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99bool StringToBool(StringPiece str, bool* value) {
100 CHECK(value != nullptr) << "NULL output boolean given.";
101 if (CaseEqual(str, "true") || CaseEqual(str, "t") || CaseEqual(str, "yes") ||
102 CaseEqual(str, "y") || CaseEqual(str, "1")) {
103 *value = true;
104 return true;
105 }
106 if (CaseEqual(str, "false") || CaseEqual(str, "f") || CaseEqual(str, "no") ||
107 CaseEqual(str, "n") || CaseEqual(str, "0")) {
108 *value = false;
109 return true;
110 }
111 return false;
112}
113} // namespace
114
115tensorflow::Status ParseCmdLine(const string& line, string* cmd,

Callers 1

ParseCmdLineFunction · 0.85

Calls 1

CaseEqualFunction · 0.85

Tested by

no test coverage detected