ONE - On-device Neural Engine
Loading...
Searching...
No Matches
tfkit::PackCommand Struct Referencefinal

#include <PackCommand.hpp>

Collaboration diagram for tfkit::PackCommand:

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 PackCommand.hpp.

Member Function Documentation

◆ run()

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

Implements cli::Command.

Definition at line 145 of file PackCommand.cpp.

146{
147 tensorflow::GraphDef graph_def;
148
149 CmdArguments cmdargs(argc, argv);
150
151 auto ioconfig = make_ioconfig(cmdargs);
152
153 google::protobuf::io::IstreamInputStream is{ioconfig->in()};
154
155 if (!google::protobuf::TextFormat::Parse(&is, &graph_def))
156 {
157 std::cerr << "ERROR: Failed to parse prototxt" << std::endl;
158 return 255;
159 }
160
161 // convert float_val to tensor_content
162 pack(graph_def);
163
164 google::protobuf::io::OstreamOutputStream os{ioconfig->out()};
165 google::protobuf::TextFormat::Print(graph_def, &os);
166
167 return 0;
168}
std::unique_ptr< IOConfiguration > make_ioconfig(const CmdArguments &cmdargs)
Definition Support.cpp:111

References tfkit::make_ioconfig().

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


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