39 arser.add_argument(
"input").help(
"Input circle model");
40 arser.add_argument(
"qparam").help(
"Quantization parameter file (.json)");
41 arser.add_argument(
"output").help(
"Output circle model");
45 arser.parse(argc, argv);
47 catch (
const std::runtime_error &err)
49 std::cerr << err.what() << std::endl;
54 if (
arser.get<
bool>(
"--verbose"))
58 setenv(
"LUCI_LOG",
"100", 0);
61 const std::string input_path =
arser.get<std::string>(
"input");
62 const std::string qparam_path =
arser.get<std::string>(
"qparam");
63 const std::string output_path =
arser.get<std::string>(
"output");
67 auto module = importerex.importVerifyModule(input_path);
68 if (module.get() ==
nullptr)
73 if (module->size() != 1)
75 std::cerr <<
"ERROR: Only a single subgraph is supported" << std::endl;
79 for (
size_t idx = 0; idx <
module->size(); ++idx)
81 auto graph =
module->graph(idx);
87 std::cerr <<
"ERROR: Quantized graph is invalid" << std::endl;
97 if (!exporter.
invoke(&contract))
99 std::cerr <<
"ERROR: Failed to export '" << output_path <<
"'" << std::endl;