From 24db75038638e1727dd3b1702d51724f384d13ff Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Tue, 17 Mar 2020 17:33:21 +0800 Subject: [PATCH] fix trt int8 calib precision bug. test=develop (#23036) --- paddle/fluid/inference/tensorrt/trt_int8_calibrator.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/tensorrt/trt_int8_calibrator.cc b/paddle/fluid/inference/tensorrt/trt_int8_calibrator.cc index 4a85c8b8fe..a6fbce2e0e 100644 --- a/paddle/fluid/inference/tensorrt/trt_int8_calibrator.cc +++ b/paddle/fluid/inference/tensorrt/trt_int8_calibrator.cc @@ -37,7 +37,8 @@ TRTInt8Calibrator::TRTInt8Calibrator( temp_tensor.Resize(data_shape); data_tensors_.push_back(temp_tensor); data_buffers_[input_name] = std::pair( - static_cast(temp_tensor.mutable_data(place)), num_ele); + static_cast(temp_tensor.mutable_data(place)), + data_size); i += 1; } } -- GitLab