diff --git a/paddle/fluid/inference/tensorrt/convert/ut_helper.h b/paddle/fluid/inference/tensorrt/convert/ut_helper.h index a4ab111eb4bc0a982e5f32fd496b96793048e1ba..39529cc2c799212f91107b1b86dd2c8c3642b6da 100644 --- a/paddle/fluid/inference/tensorrt/convert/ut_helper.h +++ b/paddle/fluid/inference/tensorrt/convert/ut_helper.h @@ -162,7 +162,8 @@ class TRTConvertValidation { size_t fluid_out_size = fluid_out.size(); if (if_add_batch_ == true) { - fluid_out_size = batch_size * (tensor->dims().size() / max_batch_size_); + fluid_out_size = + batch_size * (framework::product(tensor->dims()) / max_batch_size_); } // Compare two output ASSERT_FALSE(fluid_out.empty());