mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
Add paddle quantize model support for ORT, TRT and MKLDNN deploy backend (#257)
* add quantize model support for trt and paddle * fix bugs * fix * update paddle2onnx version * update version * add quantize test Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
7
fastdeploy/runtime.cc
Normal file → Executable file
7
fastdeploy/runtime.cc
Normal file → Executable file
@@ -198,6 +198,13 @@ void RuntimeOption::SetCpuThreadNum(int thread_num) {
|
||||
cpu_thread_num = thread_num;
|
||||
}
|
||||
|
||||
void RuntimeOption::SetOrtGraphOptLevel(int level) {
|
||||
std::vector<int> supported_level{-1, 0, 1, 2};
|
||||
auto valid_level = std::find(supported_level.begin(), supported_level.end(), level) != supported_level.end();
|
||||
FDASSERT(valid_level, "The level must be -1, 0, 1, 2.");
|
||||
ort_graph_opt_level = level;
|
||||
}
|
||||
|
||||
// use paddle inference backend
|
||||
void RuntimeOption::UsePaddleBackend() {
|
||||
#ifdef ENABLE_PADDLE_BACKEND
|
||||
|
Reference in New Issue
Block a user