Skip to content

Commit

Permalink
add ut
Browse files Browse the repository at this point in the history
Signed-off-by: Mengni Wang <[email protected]>
  • Loading branch information
mengniwang95 committed Aug 19, 2024
1 parent be59ac4 commit 6c5bd02
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/quantization/test_algorithm_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,13 @@ def test_split_shared_bias(self):
self.assertTrue(split)


def test_get_qmin_qmax_for_qType(self):
with self.assertRaises(ValueError):
quant_utils.get_qmin_qmax_for_qType(onnx.TensorProto.INT64)

qmin, qmax = quant_utils.get_qmin_qmax_for_qType(onnx.TensorProto.INT8, reduce_range=True)
self.assertEqual(qmin, -64)
self.assertEqual(qmax, 64)

if __name__ == "__main__":
unittest.main()

0 comments on commit 6c5bd02

Please sign in to comment.