From 602238949459fc522fd926bbfd027e877e2ddd17 Mon Sep 17 00:00:00 2001 From: zhoutianzi666 <39978853+zhoutianzi666@users.noreply.github.com> Date: Mon, 12 Dec 2022 10:41:08 +0800 Subject: [PATCH] forbid conv op whose weight is not a persistable weight into Paddle-TRT (#48763) --- 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 4367927bb17..4826b5ff27c 100644 --- a/paddle/fluid/inference/tensorrt/op_teller.cc +++ b/paddle/fluid/inference/tensorrt/op_teller.cc @@ -284,6 +284,15 @@ struct SimpleOpTypeSetTeller : public Teller { } } #endif + auto* block = desc.Block(); + if (block) { + auto* filter_var_desc = block->FindVar(desc.Input("Filter")[0]); + if (!filter_var_desc->Persistable()) { + VLOG(3) << "Trt not support filter is a intermediate tensor in " + "conv2d op."; + return false; + } + } } if (op_type == "deformable_conv") { -- GitLab