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

Function ReadTextProto

tensorflow/core/platform/env.cc:534–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534Status ReadTextProto(Env* env, const string& fname,
535 ::tensorflow::protobuf::Message* proto) {
536#if !defined(TENSORFLOW_LITE_PROTOS)
537 std::unique_ptr<RandomAccessFile> file;
538 TF_RETURN_IF_ERROR(env->NewRandomAccessFile(fname, &file));
539 std::unique_ptr<FileStream> stream(new FileStream(file.get()));
540
541 if (!::tensorflow::protobuf::TextFormat::Parse(stream.get(), proto)) {
542 TF_RETURN_IF_ERROR(stream->status());
543 return errors::DataLoss("Can't parse ", fname, " as text proto");
544 }
545 return Status::OK();
546#else
547 return errors::Unimplemented("Can't parse text protos with protolite.");
548#endif
549}
550
551Status ReadTextOrBinaryProto(Env* env, const string& fname,
552#if !defined(TENSORFLOW_LITE_PROTOS)

Callers 15

InitializeSessionFunction · 0.85
RealMainFunction · 0.85
ReadProtoFileFunction · 0.85
RealMainFunction · 0.85
LoadModelFunction · 0.85
NextItemMethod · 0.85
ReadGraphDefFromFileFunction · 0.85
ReadMetaGraphDefFromFileFunction · 0.85

Calls 5

ParseFunction · 0.85
UnimplementedFunction · 0.85
NewRandomAccessFileMethod · 0.45
getMethod · 0.45
statusMethod · 0.45

Tested by 4

TEST_FFunction · 0.68
TESTFunction · 0.68