ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Importer.h File Reference
#include <caffe/proto/caffe.pb.h>
#include <istream>

Go to the source code of this file.

Functions

bool from_txt (std::istream &is, ::caffe::NetParameter &param)
 
bool from_bin (std::istream &is, ::caffe::NetParameter &param)
 
bool from_txt (std::istream &is, ::caffe::PoolingParameter &param)
 

Function Documentation

◆ from_bin()

bool from_bin ( std::istream &  is,
::caffe::NetParameter &  param 
)

Definition at line 35 of file Importer.cpp.

36{
37 google::protobuf::io::IstreamInputStream iis{&is};
38 google::protobuf::io::CodedInputStream cis{&iis};
39
40 if (!param.ParseFromCodedStream(&cis))
41 {
42 return false;
43 }
44
45 return true;
46}

Referenced by make_frontend().

◆ from_txt() [1/2]

bool from_txt ( std::istream &  is,
::caffe::NetParameter &  param 
)

Definition at line 23 of file Importer.cpp.

24{
25 google::protobuf::io::IstreamInputStream iis{&is};
26
27 if (!google::protobuf::TextFormat::Parse(&iis, &param))
28 {
29 return false;
30 }
31
32 return true;
33}

Referenced by make_frontend().

◆ from_txt() [2/2]

bool from_txt ( std::istream &  is,
::caffe::PoolingParameter &  param 
)

Definition at line 48 of file Importer.cpp.

49{
50 ::google::protobuf::io::IstreamInputStream iis{&is};
51 return google::protobuf::TextFormat::Parse(&iis, &param);
52}