Skip to content

Commit

Permalink
Add compute_scale_zp unit test for 16-bit qmin/qmax
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlizarraga committed Nov 4, 2023
1 parent 08352b9 commit b9bebda
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions onnxruntime/test/python/quantization/test_quant_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def test_compute_scale_zp(self):
# Test enforcing a minimum floatint-point range.
self.assertEqual(compute_scale_zp(0.0, 0.0, 0, 255, symmetric=False, min_rrange=0.0001), [0, 0.0001 / 255])
self.assertEqual(compute_scale_zp(0.0, 0.0, -128, 127, symmetric=True, min_rrange=0.0001), [0, 0.0002 / 255])
self.assertEqual(compute_scale_zp(0.0, 0.0, 0, 65535, symmetric=False, min_rrange=0.0001), [0, 0.0001 / 65535])
self.assertEqual(compute_scale_zp(0.0, 0.0, -32768, 32767, symmetric=True, min_rrange=0.0001), [0, 0.0002 / 65535])

def test_load_external_model(self):
input_name = "input"
Expand Down

0 comments on commit b9bebda

Please sign in to comment.