From a0bceafe1610e0c120272217b924eff6ed4c624b Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Fri, 20 Mar 2020 15:57:27 +0800 Subject: [PATCH] fix trt int8 calib precision bug. test=develop (#23036) (#23087) --- 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