MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / readTextProto

Function readTextProto

parsers/caffe/caffeParser/readProto.h:69–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69bool readTextProto(trtcaffe::NetParameter* net, const char* file)
70{
71 CHECK_NULL_RET_VAL(net, false)
72 CHECK_NULL_RET_VAL(file, false)
73 using namespace google::protobuf::io;
74
75 std::ifstream stream(file, std::ios::in);
76 if (!stream)
77 {
78 RETURN_AND_LOG_ERROR(false, "Could not open file " + std::string(file));
79 }
80
81 IstreamInputStream input(&stream);
82 bool ok = google::protobuf::TextFormat::Parse(&input, net);
83 stream.close();
84 return ok;
85}
86} //namespace nvcaffeparser1
87#endif //TRT_CAFFE_PARSER_READ_PROTO_H

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected