ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tfkit::DecodeCommand Struct Referencefinal

#include <DecodeCommand.hpp>

Collaboration diagram for tfkit::DecodeCommand:

Public Member Functions

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 25 of file DecodeCommand.hpp.

Member Function Documentation

◆ run()

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

Implements cli::Command.

Definition at line 29 of file DecodeCommand.cpp.

30{
31 tensorflow::GraphDef graph_def;
32
33 CmdArguments cmdargs(argc, argv);
34
35 auto ioconfig = make_ioconfig(cmdargs);
36
37 google::protobuf::io::IstreamInputStream is{ioconfig->in()};
38 google::protobuf::io::CodedInputStream coded_is{&is};
39
40 if (!graph_def.ParseFromCodedStream(&coded_is))
41 {
42 std::cerr << "ERROR: Failed to parse tensorflow model" << std::endl;
43 return 255;
44 }
45
46 google::protobuf::io::OstreamOutputStream os{ioconfig->out()};
47 google::protobuf::TextFormat::Print(graph_def, &os);
48
49 return 0;
50}
std::unique_ptr< IOConfiguration > make_ioconfig(const CmdArguments &cmdargs)
Definition Support.cpp:111

References tfkit::make_ioconfig().


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