From 990741aa85c7d9c3df7a886d264adb2fe5482f45 Mon Sep 17 00:00:00 2001 From: nhzlx Date: Wed, 25 Jul 2018 03:45:12 +0000 Subject: [PATCH] add weight's dim assert --- paddle/fluid/inference/tensorrt/convert/conv2d_op.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/inference/tensorrt/convert/conv2d_op.cc b/paddle/fluid/inference/tensorrt/convert/conv2d_op.cc index 33f8d95d9..db32f7605 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]; -- GitLab