Skip to content

Commit 11f5a40

Browse files
authored
correct conditions of gather in opteller (#33999)
* correct conditions of gather in opteller * test=develop * test=allcase
1 parent 9f0411f commit 11f5a40

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

paddle/fluid/inference/tensorrt/op_teller.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,13 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8,
314314
}
315315

316316
if (op_type == "gather") {
317+
if (!with_dynamic_shape) return false;
318+
auto inputs = desc.InputArgumentNames();
319+
for (auto& input : inputs) {
320+
if (input == "Axis" && desc.Input("Axis").size() > 0) return false;
321+
}
317322
// current not support axis from input, use default 0
318-
if (!with_dynamic_shape || desc.Input("Axis").size() > 0) return false;
323+
if (desc.GetAttrIfExists<int>("axis")) return false;
319324
}
320325

321326
if (op_type == "gather_nd") {

0 commit comments

Comments
 (0)