ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Importer.cpp File Reference
#include "Importer.h"
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/text_format.h>

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}