20#include <onnx/onnx.pb.h>
22#include <google/protobuf/io/coded_stream.h>
23#include <google/protobuf/io/zero_copy_stream_impl.h>
24#include <google/protobuf/text_format.h>
28 onnx::ModelProto
model;
34 google::protobuf::io::IstreamInputStream is{ui->in()};
36 if (!google::protobuf::TextFormat::Parse(&is, &model))
38 std::cerr <<
"ERROR: Failed to parse text" << std::endl;
42 google::protobuf::io::OstreamOutputStream os{ui->out()};
43 google::protobuf::io::CodedOutputStream coded_os{&os};
45 if (!
model.SerializeToCodedStream(&coded_os))
47 std::cerr <<
"ERROR: Failed to serialize a ONNX model" << std::endl;
std::unique_ptr< UI > make_ui(const Cmdline &cmdargs)
int run(int argc, const char *const *argv) const override