| 270 | } |
| 271 | |
| 272 | void bindInt8(py::module& m) |
| 273 | { |
| 274 | py::enum_<CalibrationAlgoType>(m, "CalibrationAlgoType", CalibrationAlgoTypeDoc::descr, py::module_local()) |
| 275 | .value("LEGACY_CALIBRATION", CalibrationAlgoType::kLEGACY_CALIBRATION) |
| 276 | .value("ENTROPY_CALIBRATION", CalibrationAlgoType::kENTROPY_CALIBRATION) |
| 277 | .value("ENTROPY_CALIBRATION_2", CalibrationAlgoType::kENTROPY_CALIBRATION_2) |
| 278 | .value("MINMAX_CALIBRATION", CalibrationAlgoType::kMINMAX_CALIBRATION); |
| 279 | |
| 280 | py::class_<IInt8Calibrator, pyIInt8Calibrator>(m, "IInt8Calibrator", IInt8CalibratorDoc::descr, py::module_local()) |
| 281 | .def(py::init<>()) |
| 282 | .def("get_batch_size", &IInt8Calibrator::getBatchSize, IInt8CalibratorDoc::get_batch_size) |
| 283 | .def("get_algorithm", &IInt8Calibrator::getAlgorithm, IInt8CalibratorDoc::get_algorithm) |
| 284 | // For documentation purposes only |
| 285 | .def("get_batch", docGetBatch<IInt8Calibrator>, "names"_a, IInt8CalibratorDoc::get_batch) |
| 286 | .def("read_calibration_cache", docReadCalibrationCache<IInt8Calibrator>, |
| 287 | IInt8CalibratorDoc::read_calibration_cache) |
| 288 | .def("write_calibration_cache", docWriteCalibrationCache<IInt8Calibrator>, "cache"_a, |
| 289 | IInt8CalibratorDoc::write_calibration_cache); |
| 290 | |
| 291 | py::class_<IInt8LegacyCalibrator, IInt8Calibrator, pyIInt8LegacyCalibrator>( |
| 292 | m, "IInt8LegacyCalibrator", IInt8LegacyCalibratorDoc::descr, py::module_local()) |
| 293 | .def(py::init<>()) |
| 294 | .def("get_batch_size", &IInt8LegacyCalibrator::getBatchSize, IInt8CalibratorDoc::get_batch_size) |
| 295 | .def("get_algorithm", &IInt8LegacyCalibrator::getAlgorithm, IInt8LegacyCalibratorDoc::get_algorithm) |
| 296 | // For documentation purposes only |
| 297 | .def("get_batch", docGetBatch<IInt8LegacyCalibrator>, "names"_a, IInt8CalibratorDoc::get_batch) |
| 298 | .def("read_calibration_cache", docReadCalibrationCache<IInt8LegacyCalibrator>, |
| 299 | IInt8CalibratorDoc::read_calibration_cache) |
| 300 | .def("write_calibration_cache", docWriteCalibrationCache<IInt8LegacyCalibrator>, "cache"_a, |
| 301 | IInt8CalibratorDoc::write_calibration_cache); |
| 302 | |
| 303 | py::class_<IInt8EntropyCalibrator, IInt8Calibrator, pyCalibratorTrampoline<IInt8EntropyCalibrator>>( |
| 304 | m, "IInt8EntropyCalibrator", IInt8EntropyCalibratorDoc::descr, py::module_local()) |
| 305 | .def(py::init<>()) |
| 306 | .def("get_batch_size", &IInt8EntropyCalibrator::getBatchSize, IInt8CalibratorDoc::get_batch_size) |
| 307 | .def("get_algorithm", &IInt8EntropyCalibrator::getAlgorithm, IInt8EntropyCalibratorDoc::get_algorithm) |
| 308 | // For documentation purposes only |
| 309 | .def("get_batch", docGetBatch<IInt8EntropyCalibrator>, "names"_a, IInt8CalibratorDoc::get_batch) |
| 310 | .def("read_calibration_cache", docReadCalibrationCache<IInt8EntropyCalibrator>, |
| 311 | IInt8CalibratorDoc::read_calibration_cache) |
| 312 | .def("write_calibration_cache", docWriteCalibrationCache<IInt8EntropyCalibrator>, "cache"_a, |
| 313 | IInt8CalibratorDoc::write_calibration_cache); |
| 314 | |
| 315 | py::class_<IInt8EntropyCalibrator2, IInt8Calibrator, pyCalibratorTrampoline<IInt8EntropyCalibrator2>>( |
| 316 | m, "IInt8EntropyCalibrator2", IInt8EntropyCalibrator2Doc::descr, py::module_local()) |
| 317 | .def(py::init<>()) |
| 318 | .def("get_batch_size", &IInt8EntropyCalibrator2::getBatchSize, IInt8CalibratorDoc::get_batch_size) |
| 319 | .def("get_algorithm", &IInt8EntropyCalibrator2::getAlgorithm, IInt8EntropyCalibrator2Doc::get_algorithm) |
| 320 | // For documentation purposes only |
| 321 | .def("get_batch", docGetBatch<IInt8EntropyCalibrator2>, "names"_a, IInt8CalibratorDoc::get_batch) |
| 322 | .def("read_calibration_cache", docReadCalibrationCache<IInt8EntropyCalibrator2>, |
| 323 | IInt8CalibratorDoc::read_calibration_cache) |
| 324 | .def("write_calibration_cache", docWriteCalibrationCache<IInt8EntropyCalibrator2>, "cache"_a, |
| 325 | IInt8CalibratorDoc::write_calibration_cache); |
| 326 | |
| 327 | py::class_<IInt8MinMaxCalibrator, IInt8Calibrator, pyCalibratorTrampoline<IInt8MinMaxCalibrator>>( |
| 328 | m, "IInt8MinMaxCalibrator", IInt8MinMaxCalibratorDoc::descr, py::module_local()) |
| 329 | .def(py::init<>()) |