QAT int8 accuracy little improvement (#21074)

test=develop
revert-21172-masked_select_api
joanna.wozna.intel 5 years ago committed by Tao Luo
parent 8414575b78
commit 37e0e7a96b

@ -514,11 +514,11 @@ class FakeQAT2MkldnnINT8PerfPass(object):
weights = np.array( weights = np.array(
self._load_param(self._scope, weight_var_name)) self._load_param(self._scope, weight_var_name))
scales = 1.0 / np.amax( scales = 1.0 / np.amax(
np.abs(weights.reshape(weights.shape[0], -1)), np.abs(weights.reshape(weights.shape[0], -1)).astype(
np.float64),
axis=axis) axis=axis)
lod_tensor = self._convert_scale2tensor( lod_tensor = self._convert_scale2tensor(scales)
scales.astype(np.float64))
use_unsigned_int = False use_unsigned_int = False
self._var_quant_scales[weight_var_name] = (use_unsigned_int, self._var_quant_scales[weight_var_name] = (use_unsigned_int,
lod_tensor) lod_tensor)

Loading…
Cancel
Save