| 161 | } |
| 162 | |
| 163 | int entry(int argc, char **argv) |
| 164 | { |
| 165 | luci::CircleQuantizer quantizer; |
| 166 | |
| 167 | auto options = quantizer.options(); |
| 168 | auto settings = luci::UserSettings::settings(); |
| 169 | |
| 170 | const std::string qdqw = "--quantize_dequantize_weights"; |
| 171 | const std::string qwmm = "--quantize_with_minmax"; |
| 172 | const std::string qofm = "--quantize_onnx_fq_model"; |
| 173 | const std::string rq = "--requantize"; |
| 174 | const std::string fq = "--force_quantparam"; |
| 175 | const std::string cq = "--copy_quantparam"; |
| 176 | const std::string fake_quant = "--fake_quantize"; |
| 177 | const std::string qw = "--quantize_weights"; |
| 178 | const std::string cfg = "--config"; |
| 179 | |
| 180 | const std::string tf_maxpool = "--TF-style_maxpool"; |
| 181 | |
| 182 | const std::string gpd = "--generate_profile_data"; |
| 183 | |
| 184 | const std::string save_min_max = "--save_min_max"; |
| 185 | |
| 186 | arser::Arser arser("circle-quantizer provides circle model quantization"); |
| 187 | |
| 188 | arser::Helper::add_version(arser, print_version); |
| 189 | arser::Helper::add_verbose(arser); |
| 190 | |
| 191 | arser.add_argument(qofm).nargs(0).default_value(false).help( |
| 192 | "Quantize Onnx fake-quantized (with QDQ) model"); |
| 193 | |
| 194 | arser.add_argument(qdqw) |
| 195 | .nargs(3) |
| 196 | .type(arser::DataType::STR_VEC) |
| 197 | .help("Quantize-dequantize weight values required action before quantization. " |
| 198 | "Three arguments required: input_model_dtype(float32) " |
| 199 | "output_model_dtype(uint8) granularity(layer, channel)"); |
| 200 | |
| 201 | arser.add_argument(qwmm) |
| 202 | .nargs(3) |
| 203 | .type(arser::DataType::STR_VEC) |
| 204 | .help("Quantize with min/max values. " |
| 205 | "Three arguments required: input_model_dtype(float32) " |
| 206 | "output_model_dtype(uint8) granularity(layer, channel)"); |
| 207 | |
| 208 | arser.add_argument(tf_maxpool) |
| 209 | .nargs(0) |
| 210 | .default_value(false) |
| 211 | .help("Force MaxPool Op to have the same input/output quantparams. NOTE: This feature can " |
| 212 | "degrade accuracy of some models"); |
| 213 | |
| 214 | arser.add_argument(save_min_max) |
| 215 | .nargs(0) |
| 216 | .default_value(false) |
| 217 | .help("Save recorded min/max values."); |
| 218 | |
| 219 | arser.add_argument(fake_quant) |
| 220 | .nargs(0) |
nothing calls this directly
no test coverage detected