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

Method LoadFile

tensorflow/core/framework/op_gen_lib.cc:489–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487}
488
489Status ApiDefMap::LoadFile(Env* env, const string& filename) {
490 if (filename.empty()) return Status::OK();
491 string contents;
492 TF_RETURN_IF_ERROR(ReadFileToString(env, filename, &contents));
493 Status status = LoadApiDef(contents);
494 if (!status.ok()) {
495 // Return failed status annotated with filename to aid in debugging.
496 return Status(status.code(),
497 strings::StrCat("Error parsing ApiDef file ", filename, ": ",
498 status.error_message()));
499 }
500 return Status::OK();
501}
502
503Status ApiDefMap::LoadApiDef(const string& api_def_file_contents) {
504 const string contents = PBTxtFromMultiline(api_def_file_contents);

Callers 2

RunMethod · 0.80
PrintAllCCOpsFunction · 0.80

Calls 6

ReadFileToStringFunction · 0.85
StatusClass · 0.50
StrCatFunction · 0.50
emptyMethod · 0.45
okMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected