Skip to content

Commit 990741a

Browse files
committed
add weight's dim assert
1 parent fc41eb4 commit 990741a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

paddle/fluid/inference/tensorrt/convert/conv2d_op.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Conv2dOpConverter : public OpConverter {
3737
auto* Y_t = Y_v->GetMutable<framework::LoDTensor>();
3838
auto* weight_data = Y_t->mutable_data<float>(platform::CPUPlace());
3939

40+
PADDLE_ENFORCE(Y_t->dims().size(), 4UL);
4041
const int n_output = Y_t->dims()[0];
4142
const int filter_h = Y_t->dims()[2];
4243
const int filter_w = Y_t->dims()[3];

0 commit comments

Comments
 (0)