ONE - On-device Neural Engine
Loading...
Searching...
No Matches
EncodeCommand Struct Referencefinal

#include <EncodeCommand.h>

Collaboration diagram for EncodeCommand:

Public Member Functions

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
 

Detailed Description

Definition at line 22 of file EncodeCommand.h.

Member Function Documentation

◆ 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 // Load text from standard input
32 google::protobuf::io::IstreamInputStream is{&std::cin};
33
34 if (!google::protobuf::TextFormat::Parse(&is, &param))
35 {
36 std::cerr << "ERROR: Failed to parse prototxt" << std::endl;
37 return 255;
38 }
39
40 // Write binary into standard output
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}

Referenced by package.infer.session::inference().

◆ 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: