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

#include <DecodeCommand.h>

Collaboration diagram for DecodeCommand:

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 DecodeCommand.h.

Member Function Documentation

◆ run() [1/2]

int DecodeCommand::run ( int  argc,
const char *const *  argv 
) const
overridevirtual

Implements cli::Command.

Definition at line 27 of file DecodeCommand.cpp.

28{
29 caffe::NetParameter param;
30
31 // Load binary from standard input
32 google::protobuf::io::IstreamInputStream is{&std::cin};
33 google::protobuf::io::CodedInputStream coded_is{&is};
34
35 if (!param.ParseFromCodedStream(&coded_is))
36 {
37 std::cerr << "ERROR: Failed to parse caffemodel" << std::endl;
38 return 255;
39 }
40
41 // Write text into standard output
42 google::protobuf::io::OstreamOutputStream os{&std::cout};
43 google::protobuf::TextFormat::Print(param, &os);
44
45 return 0;
46}

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

◆ run() [2/2]

int DecodeCommand::run ( int  argc,
const char *const *  argv 
) const
overridevirtual

The documentation for this struct was generated from the following files: