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

#include <UnpackCommand.hpp>

Collaboration diagram for tfkit::UnpackCommand:

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

Member Function Documentation

◆ run()

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

Implements cli::Command.

Definition at line 212 of file UnpackCommand.cpp.

213{
214 tensorflow::GraphDef graph_def;
215
216 CmdArguments cmdargs(argc, argv);
217
218 auto ioconfig = make_ioconfig(cmdargs);
219
220 google::protobuf::io::IstreamInputStream is{ioconfig->in()};
221
222 if (!google::protobuf::TextFormat::Parse(&is, &graph_def))
223 {
224 std::cerr << "ERROR: Failed to parse prototxt" << std::endl;
225 return 255;
226 }
227
228 // convert tensor_content to float_val
229 unpack(graph_def);
230
231 google::protobuf::io::OstreamOutputStream os{ioconfig->out()};
232 google::protobuf::TextFormat::Print(graph_def, &os);
233
234 return 0;
235}
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: