From 11f5a400b91fa2ff425273a3a03fbaa6fb048424 Mon Sep 17 00:00:00 2001 From: wenbin Date: Thu, 8 Jul 2021 20:48:18 +0800 Subject: [PATCH] correct conditions of gather in opteller (#33999) * correct conditions of gather in opteller * test=develop * test=allcase --- paddle/fluid/inference/tensorrt/op_teller.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/tensorrt/op_teller.cc b/paddle/fluid/inference/tensorrt/op_teller.cc index cfbe3957ad4..f98b0c9ede7 100644 --- a/paddle/fluid/inference/tensorrt/op_teller.cc +++ b/paddle/fluid/inference/tensorrt/op_teller.cc @@ -314,8 +314,13 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8, } if (op_type == "gather") { + if (!with_dynamic_shape) return false; + auto inputs = desc.InputArgumentNames(); + for (auto& input : inputs) { + if (input == "Axis" && desc.Input("Axis").size() > 0) return false; + } // current not support axis from input, use default 0 - if (!with_dynamic_shape || desc.Input("Axis").size() > 0) return false; + if (desc.GetAttrIfExists("axis")) return false; } if (op_type == "gather_nd") { -- GitLab