From 28f04c6a5ee4ae037364b757464c23f4f8cb5a58 Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Fri, 10 Apr 2020 15:48:43 +0800 Subject: [PATCH] refine shuffle channel errmsg, test=develop (#23520) --- .../fluid/inference/tensorrt/convert/shuffle_channel_op.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/tensorrt/convert/shuffle_channel_op.cc b/paddle/fluid/inference/tensorrt/convert/shuffle_channel_op.cc index 0f891e0f9f4..471f3959747 100644 --- a/paddle/fluid/inference/tensorrt/convert/shuffle_channel_op.cc +++ b/paddle/fluid/inference/tensorrt/convert/shuffle_channel_op.cc @@ -29,7 +29,12 @@ class ShuffleChannelOpConverter : public OpConverter { // Declare inputs auto* input = engine_->GetITensor(op_desc.Input("X")[0]); auto input_dims = input->getDimensions(); - PADDLE_ENFORCE(input_dims.nbDims == 3); + PADDLE_ENFORCE_EQ( + input_dims.nbDims, 3, + platform::errors::InvalidArgument("ShuffleChannel TRT op converter " + "input dims is invalid. The input " + "dims size should be 3, but got %d.", + input_dims.nbDims)); int c = input_dims.d[0]; int h = input_dims.d[1]; int w = input_dims.d[2]; -- GitLab