46 arser::Arser arser(
"circle-opselector provides selecting operations in circle model");
52 arser.add_argument(
"input").help(
"Input circle model");
53 arser.add_argument(
"output").help(
"Output circle model");
56 arser.add_argument(
"--by_id").help(
"Input operation id to select nodes.");
57 arser.add_argument(
"--by_name").help(
"Input operation name to select nodes.");
61 arser.parse(argc, argv);
63 catch (
const std::runtime_error &err)
65 std::cerr << err.what() << std::endl;
70 std::string input_path =
arser.get<std::string>(
"input");
71 std::string output_path =
arser.get<std::string>(
"output");
75 std::cerr <<
"ERROR: Either option '--by_id' or '--by_name' must be specified" << std::endl;
82 auto module = importerex.importVerifyModule(input_path);
85 if (module.get()->size() > 1)
87 std::cout <<
"WARNING: Only first subgraph's operators will be selected" << std::endl;
92 std::unique_ptr<luci::Module> new_module;
93 std::string operator_input;
97 operator_input =
arser.get<std::string>(
"--by_id");
100 if (
arser[
"--by_name"])
102 operator_input =
arser.get<std::string>(
"--by_name");
108 std::cerr <<
"ERROR: Cannot export the module" << std::endl;