Skip to content

Commit 3c26824

Browse files
committed
correct conditions of gather in opteller
1 parent b1c458d commit 3c26824

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

paddle/fluid/inference/tensorrt/op_teller.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,14 @@ 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+
319+
auto inputs = desc.InputArgumentNames();
320+
for (auto& input : inputs) {
321+
if (input == "Axis" && desc.Input("Axis").size() > 0) return false;
322+
}
317323
// current not support axis from input, use default 0
318-
if (!with_dynamic_shape || desc.Input("Axis").size() > 0) return false;
324+
if (desc.GetAttrIfExists<int>("axis")) return false;
319325
}
320326

321327
if (op_type == "gather_nd") {

0 commit comments

Comments
 (0)