diff --git a/python/paddle/fluid/contrib/int8_inference/utility.py b/python/paddle/fluid/contrib/int8_inference/utility.py index b35d9f2424ccf093f70e75b13e23f6c5ad59e859..605dfdf53d0cb44972defcc3f86aa95982b82e41 100644 --- a/python/paddle/fluid/contrib/int8_inference/utility.py +++ b/python/paddle/fluid/contrib/int8_inference/utility.py @@ -634,7 +634,8 @@ class Calibrator(object): break starting_iter = int(0.6 * ending_iter) bin_width = hist_edeges[1] - hist_edeges[0] - P_sum = len(activation_blob) + + P_sum = len(np.array(activation_blob).ravel()) min_kl_divergence = 0 min_kl_index = 0 kl_inited = False