diff --git a/paddle/fluid/inference/tensorrt/convert/conv2d_op.cc b/paddle/fluid/inference/tensorrt/convert/conv2d_op.cc index 33f8d95d9c76dbc78c3d19b2c9068d6d91d70760..db32f7605492266677b641402813c84d2bb90c3d 100644 --- a/paddle/fluid/inference/tensorrt/convert/conv2d_op.cc +++ b/paddle/fluid/inference/tensorrt/convert/conv2d_op.cc @@ -37,6 +37,7 @@ class Conv2dOpConverter : public OpConverter { auto* Y_t = Y_v->GetMutable(); auto* weight_data = Y_t->mutable_data(platform::CPUPlace()); + PADDLE_ENFORCE(Y_t->dims().size(), 4UL); const int n_output = Y_t->dims()[0]; const int filter_h = Y_t->dims()[2]; const int filter_w = Y_t->dims()[3];