39 arser.add_argument(
"--input").required().help(
"Input circle model");
41 arser.add_argument(
"--output")
43 .help(
"Output json file that describes equalization patterns");
45 arser.add_argument(
"--allow_dup_op")
48 .help(
"Allow to create duplicate operations when a feature map matches "
49 "with multiple equalization patterns. This can increase the size of "
50 "the model. Default is false.");
54 arser.parse(argc, argv);
56 catch (
const std::runtime_error &err)
58 std::cerr << err.what() << std::endl;
63 if (
arser.get<
bool>(
"--verbose"))
67 setenv(
"LUCI_LOG",
"100", 0);
70 const std::string input_path =
arser.get<std::string>(
"--input");
71 const std::string output_path =
arser.get<std::string>(
"--output");
72 const bool allow_dup_op =
arser.get<
bool>(
"--allow_dup_op");
81 auto module = importerex.importVerifyModule(input_path);
82 assert(module !=
nullptr);
84 std::vector<EqualizePattern> patterns;
85 for (
size_t idx = 0; idx <
module->size(); ++idx)
87 auto graph =
module->graph(idx);
89 auto matched = finder.
find(graph);
90 patterns.insert(patterns.end(), matched.begin(), matched.end());