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

Function ReadBinaryProto

tensorflow/core/platform/env.cc:505–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505Status ReadBinaryProto(Env* env, const string& fname,
506 ::tensorflow::protobuf::MessageLite* proto) {
507 std::unique_ptr<RandomAccessFile> file;
508 TF_RETURN_IF_ERROR(env->NewRandomAccessFile(fname, &file));
509 std::unique_ptr<FileStream> stream(new FileStream(file.get()));
510
511 ::tensorflow::protobuf::io::CodedInputStream coded_stream(stream.get());
512
513 if (!proto->ParseFromCodedStream(&coded_stream) ||
514 !coded_stream.ConsumedEntireMessage()) {
515 TF_RETURN_IF_ERROR(stream->status());
516 return errors::DataLoss("Can't parse ", fname, " as binary proto");
517 }
518 return Status::OK();
519}
520
521Status WriteTextProto(Env* env, const string& fname,
522 const ::tensorflow::protobuf::Message& proto) {

Callers 15

InitializeSessionFunction · 0.85
TestConstantFoldingMethod · 0.85
CopyExportFunction · 0.85
CandidateGraphRunnerMethod · 0.85
LoadGraphFunction · 0.85
LoadGraphFunction · 0.85
TESTFunction · 0.85
ReadProtoFileFunction · 0.85
RealMainFunction · 0.85

Calls 3

NewRandomAccessFileMethod · 0.45
getMethod · 0.45
statusMethod · 0.45

Tested by 10

TestConstantFoldingMethod · 0.68
CopyExportFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TFProfShowTestMethod · 0.68
TFProfStatsTestMethod · 0.68
TESTFunction · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68
LoadGraphFunction · 0.68