We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01c26ab commit 0699afbCopy full SHA for 0699afb
paddle/fluid/inference/tensorrt/op_teller.cc
@@ -639,8 +639,12 @@ struct SimpleOpTypeSetTeller : public Teller {
639
int axis = desc.HasAttr("axis")
640
? PADDLE_GET_CONST(int64_t, desc.GetAttr("axis"))
641
: -1;
642
- bool flatten = PADDLE_GET_CONST(bool, desc.GetAttr("flatten"));
643
- int dtype = PADDLE_GET_CONST(int, desc.GetAttr("dtype"));
+ bool flatten = desc.HasAttr("flatten")
+ ? 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;
648
if (axis == 0 || flatten || dtype != 2) return false;
649
}
650
0 commit comments