Skip to content

Commit 0699afb

Browse files
fix_arg_release24 (#49771)
1 parent 01c26ab commit 0699afb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

paddle/fluid/inference/tensorrt/op_teller.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,12 @@ struct SimpleOpTypeSetTeller : public Teller {
639639
int axis = desc.HasAttr("axis")
640640
? PADDLE_GET_CONST(int64_t, desc.GetAttr("axis"))
641641
: -1;
642-
bool flatten = PADDLE_GET_CONST(bool, desc.GetAttr("flatten"));
643-
int dtype = PADDLE_GET_CONST(int, desc.GetAttr("dtype"));
642+
bool flatten = desc.HasAttr("flatten")
643+
? PADDLE_GET_CONST(bool, desc.GetAttr("flatten"))
644+
: false;
645+
int dtype = desc.HasAttr("dtype")
646+
? PADDLE_GET_CONST(int, desc.GetAttr("dtype"))
647+
: 3;
644648
if (axis == 0 || flatten || dtype != 2) return false;
645649
}
646650

0 commit comments

Comments
 (0)