From 45b4bf39b43af7759c869f978e41ecef00a34d5a Mon Sep 17 00:00:00 2001 From: Michael Suo Date: Fri, 6 Sep 2019 22:25:16 -0700 Subject: [PATCH] Update test_quantized.py --- test/test_quantized.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_quantized.py b/test/test_quantized.py index 4b021b63429d..4d95920f6c6b 100644 --- a/test/test_quantized.py +++ b/test/test_quantized.py @@ -15,11 +15,11 @@ def canonical(graph): def _quantize(x, scale, zero_point, qmin=0, qmax=255, qtype=np.uint8): """Quantizes a numpy array.""" qx = np.round(x/scale + zero_point) - qx = np.clip(qx, qmin, qmax).astype(qtype) + qx = np.clip(qx,qmin, qmax).astype(qtype) return qx -def _dequantize(qx, scale, zero_point): +def _dequantize(qx,scale, zero_point): """Dequantizes a numpy array.""" x = (qx.astype(np.float) - zero_point) * scale return x