From 9e0baf6efff6d7c5c370070bb98057776f920001 Mon Sep 17 00:00:00 2001 From: Yuanle Liu Date: Wed, 24 Aug 2022 18:43:40 +0800 Subject: [PATCH] fix op_teller with_dynamic_shape judge bug (#45384) --- paddle/fluid/inference/tensorrt/op_teller.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/inference/tensorrt/op_teller.cc b/paddle/fluid/inference/tensorrt/op_teller.cc index eaa2188623..32e999b879 100644 --- a/paddle/fluid/inference/tensorrt/op_teller.cc +++ b/paddle/fluid/inference/tensorrt/op_teller.cc @@ -340,9 +340,9 @@ bool OpTeller::Tell(const framework::ir::Node* node, if (!with_dynamic_shape) { std::string X_name; auto inputs = desc.Inputs(); - if (inputs.count("X")) { + if (inputs.count("X") && !desc.Input("X").empty()) { X_name = desc.Input("X")[0]; - } else if (inputs.count("Input")) { + } else if (inputs.count("Input") && !desc.Input("Input").empty()) { X_name = desc.Input("Input")[0]; } auto* block = desc.Block(); -- GitLab