From 766a4ca9573587f3203162b6c4040c184b493497 Mon Sep 17 00:00:00 2001 From: xiaoxiaohehe001 <49090790+xiaoxiaohehe001@users.noreply.github.com> Date: Tue, 7 Feb 2023 21:07:03 +0800 Subject: [PATCH] [Paddle Inference] Fix range fp32 input below trt 8.4. (#50221) --- paddle/fluid/inference/tensorrt/op_teller.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paddle/fluid/inference/tensorrt/op_teller.cc b/paddle/fluid/inference/tensorrt/op_teller.cc index 06b2b0348d7..3a5742e326c 100644 --- a/paddle/fluid/inference/tensorrt/op_teller.cc +++ b/paddle/fluid/inference/tensorrt/op_teller.cc @@ -360,6 +360,15 @@ struct SimpleOpTypeSetTeller : public Teller { if (!with_dynamic_shape) { return false; } +#if IS_TRT_VERSION_LT(8400) + auto* block = desc.Block(); + auto start_var_name = desc.Input("Start")[0]; + auto* start_var_desc = block->FindVar(start_var_name); + auto start_dtype = start_var_desc->GetDataType(); + if (start_dtype == framework::proto::VarType::FP32) { + return false; + } +#endif } if (op_type == "sign") { -- GitLab