Created by: NHZlX
This PR changes the EnableTensorRtEngine interface, we add three parameters to control the dynamic shape mode:min_input_shape, max_input_shape, opt_input_shape.
The three parameters represents the min, max, optimization shape of the input.
Although dynamic shape is supported, but TRT only optimizes and selects kernel for one shape(opt_input_shape).
EG:
std::map<std::string, std::vector<int>> min_input_shape = {{"image", {1,1,3,3}}};
std::map<std::string, std::vector<int>> max_input_shape = {{"image", {1,1,10,10}}};
std::map<std::string, std::vector<int>> opt_input_shape = {{"image", {1,1,3,3}}};
config->EnableTensorRtEngine(1 << 20, batch_size, 0,
AnalysisConfig::Precision::kFloat32, false, true, min_input_shape,
max_input_shape, opt_input_shape);