Commit a8fadc6f authored by Shucai Xiao's avatar Shucai Xiao
Browse files

add python interface for quantize int8.

parent 4d1f18a8
...@@ -153,6 +153,7 @@ PYBIND11_MODULE(migraphx, m) ...@@ -153,6 +153,7 @@ PYBIND11_MODULE(migraphx, m)
py::class_<migraphx::target>(m, "target"); py::class_<migraphx::target>(m, "target");
py::class_<migraphx::program>(m, "program") py::class_<migraphx::program>(m, "program")
.def("clone", [](migraphx::program& p) { return *(new migraphx::program(p)); })
.def("get_parameter_shapes", &migraphx::program::get_parameter_shapes) .def("get_parameter_shapes", &migraphx::program::get_parameter_shapes)
.def("get_shape", &migraphx::program::get_shape) .def("get_shape", &migraphx::program::get_shape)
.def("compile", [](migraphx::program& p, const migraphx::target& t) { p.compile(t); }) .def("compile", [](migraphx::program& p, const migraphx::target& t) { p.compile(t); })
...@@ -192,6 +193,7 @@ PYBIND11_MODULE(migraphx, m) ...@@ -192,6 +193,7 @@ PYBIND11_MODULE(migraphx, m)
std::vector<std::pair<float, float>>& quant_params) { std::vector<std::pair<float, float>>& quant_params) {
migraphx::quantize_int8(p, ins_names, quant_params); migraphx::quantize_int8(p, ins_names, quant_params);
}); });
m.def("quantize_int8", [](migraphx::program& p) { migraphx::quantize_int8(p); });
#ifdef HAVE_GPU #ifdef HAVE_GPU
m.def("allocate_gpu", &migraphx::gpu::allocate_gpu, py::arg("s"), py::arg("host") = false); m.def("allocate_gpu", &migraphx::gpu::allocate_gpu, py::arg("s"), py::arg("host") = false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment