#include <EncodeCommand.h>
|
int | run (int argc, const char *const *argv) const override |
|
int | run (int argc, const char *const *argv) const override |
|
Public Member Functions inherited from cli::Command |
virtual | ~Command ()=default |
|
Definition at line 22 of file EncodeCommand.h.
◆ run() [1/2]
int EncodeCommand::run |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| const |
|
overridevirtual |
Implements cli::Command.
Definition at line 27 of file EncodeCommand.cpp.
28{
29 caffe::NetParameter param;
30
31
32 google::protobuf::io::IstreamInputStream is{&std::cin};
33
34 if (!google::protobuf::TextFormat::Parse(&is, ¶m))
35 {
36 std::cerr << "ERROR: Failed to parse prototxt" << std::endl;
37 return 255;
38 }
39
40
41 google::protobuf::io::OstreamOutputStream os{&std::cout};
42 google::protobuf::io::CodedOutputStream coded_os{&os};
43
44 if (!param.SerializeToCodedStream(&coded_os))
45 {
46 std::cerr << "ERROR: Failed to serialize" << std::endl;
47 return 255;
48 }
49
50 return 0;
51}
◆ run() [2/2]
int EncodeCommand::run |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| const |
|
overridevirtual |
The documentation for this struct was generated from the following files: