ai-edge-quantizer-nightly 0.5.0.dev20260103__py3-none-any.whl → 0.5.0.dev20260112__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -346,6 +346,7 @@ def _materialize_bias_for_fc_conv_ops(
346
346
  bias_content,
347
347
  input_consumer_params,
348
348
  weight_consumer_params,
349
+ not op_info.op_quant_config.skip_checks,
349
350
  )
350
351
  )
351
352
  except ValueError as e:
@@ -414,7 +414,10 @@ class TensorUtilsTest(parameterized.TestCase):
414
414
  list(bias_quant_config.quantized_data.flatten()), # pytype: disable=attribute-error
415
415
  )
416
416
 
417
- def test_quantize_bias_tensor_raises_error_for_large_quantization_error(self):
417
+ @parameterized.parameters(True, False)
418
+ def test_quantize_bias_tensor_raises_error_for_large_quantization_error(
419
+ self, check_error
420
+ ):
418
421
  input_quant_config = qtyping.UniformQuantParams(
419
422
  scale=np.array([0.1]),
420
423
  zero_point=np.array([10]),
@@ -431,14 +434,26 @@ class TensorUtilsTest(parameterized.TestCase):
431
434
  )
432
435
  # This will result in quantized bias of 3e9, which is larger than int32 max.
433
436
  bias_tensor_data = np.array([3e7])
434
- with self.assertRaisesRegex(
435
- ValueError,
436
- "Quantization error is too large for bias tensor quantization.",
437
- ):
438
- uniform_quantize_tensor.symmetric_quantize_bias_tensor(
439
- bias_tensor_data,
440
- input_quant_config,
441
- weight_quant_config,
437
+
438
+ if check_error:
439
+ with self.assertRaisesRegex(
440
+ ValueError,
441
+ "Quantization error is too large for bias tensor quantization.",
442
+ ):
443
+ uniform_quantize_tensor.symmetric_quantize_bias_tensor(
444
+ bias_tensor_data,
445
+ input_quant_config,
446
+ weight_quant_config,
447
+ check_error
448
+ )
449
+ else:
450
+ self.assertIsNotNone(
451
+ uniform_quantize_tensor.symmetric_quantize_bias_tensor(
452
+ bias_tensor_data,
453
+ input_quant_config,
454
+ weight_quant_config,
455
+ check_error,
456
+ )
442
457
  )
443
458
 
444
459
  @parameterized.parameters((8, True), (16, False))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ai-edge-quantizer-nightly
3
- Version: 0.5.0.dev20260103
3
+ Version: 0.5.0.dev20260112
4
4
  Summary: A quantizer for advanced developers to quantize converted AI Edge models.
5
5
  Home-page: https://github.com/google-ai-edge/ai-edge-quantizer
6
6
  Keywords: On-Device ML,AI,Google,TFLite,Quantization,LLMs,GenAI
@@ -28,7 +28,7 @@ ai_edge_quantizer/algorithms/nonlinear_quantize/__init__.py,sha256=lpq1g2ayg3lCP
28
28
  ai_edge_quantizer/algorithms/nonlinear_quantize/float_casting.py,sha256=Bs9CK7wZAw6jNaZ8xEtbwO2vM34VYXNZSMVWvxJo9nw,9297
29
29
  ai_edge_quantizer/algorithms/nonlinear_quantize/float_casting_test.py,sha256=EqIHGEZ1LgUrTN7zf880RuAzEv3Qy7kgh5ivObJGHSo,22646
30
30
  ai_edge_quantizer/algorithms/uniform_quantize/__init__.py,sha256=lpq1g2ayg3lCPLy79t2VicYcnGKw64FfYIj1V7J-4m8,676
31
- ai_edge_quantizer/algorithms/uniform_quantize/common_quantize.py,sha256=_ItPnd2TXj95QimjiPaJOKcyfW_C5emIougygNTaZxA,42072
31
+ ai_edge_quantizer/algorithms/uniform_quantize/common_quantize.py,sha256=7xLbcm34nRnKLi3Rb_SdGNuXrXwEuC0t6hNAY3d0aSM,42129
32
32
  ai_edge_quantizer/algorithms/uniform_quantize/common_quantize_test.py,sha256=GGf_n3wIeg3GB_eGsmyNJ0fTcxgpeMMbugTMRONK6TQ,3553
33
33
  ai_edge_quantizer/algorithms/uniform_quantize/dequantized_weight_recovery.py,sha256=VjBDxGxjITHJc7xJABqBbZt6_qhobtZAl2gnVQrYJgc,8652
34
34
  ai_edge_quantizer/algorithms/uniform_quantize/dequantized_weight_recovery_test.py,sha256=sT5eX5TLZEHTtPfnSkCPDlS0sQxlTFWbCsbvOuj--yY,8889
@@ -41,7 +41,7 @@ ai_edge_quantizer/algorithms/uniform_quantize/naive_min_max_quantize_test.py,sha
41
41
  ai_edge_quantizer/algorithms/uniform_quantize/octav.py,sha256=-n-QZyp9y8WCy5FPSpXZXHfOA-p-RLvfSaCzAfhHiHI,7040
42
42
  ai_edge_quantizer/algorithms/uniform_quantize/octav_test.py,sha256=6m2U-9JdNei0XzOORg2gt87TJdD0XHZ-z5h9c4g_TB4,9120
43
43
  ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor.py,sha256=qZxTj3B-tqNTLCViwuJj285YncvwjWeay2QKWd8nr6A,20420
44
- ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor_test.py,sha256=eTrrc8AGaSf1Ytp5gsRONAZ94PHFJUTd4dGi5ZnKZjU,16038
44
+ ai_edge_quantizer/algorithms/uniform_quantize/uniform_quantize_tensor_test.py,sha256=2BBSNqB37Smo8t9CZJShlT6JZMpuw4RWRvAGHBTr3OA,16417
45
45
  ai_edge_quantizer/algorithms/utils/__init__.py,sha256=lpq1g2ayg3lCPLy79t2VicYcnGKw64FfYIj1V7J-4m8,676
46
46
  ai_edge_quantizer/algorithms/utils/common_utils.py,sha256=M3VZsdLC4jCPfSI_aGAY4XjiHvoXtR-UyPZdZdz8GD0,38082
47
47
  ai_edge_quantizer/algorithms/utils/common_utils_test.py,sha256=zqapGEfYhjQWe9cNGPLmdbwtEUUYQRhlO_kNe0cXX6E,18104
@@ -74,8 +74,8 @@ ai_edge_quantizer/utils/tfl_interpreter_utils.py,sha256=ptdlC3WVUE9aBznT7kZQ0ZOk
74
74
  ai_edge_quantizer/utils/tfl_interpreter_utils_test.py,sha256=EPOXbmXqbt3tAewo3BQQjh2mjuxrrFit5tkF0wUVYHU,12471
75
75
  ai_edge_quantizer/utils/validation_utils.py,sha256=Mr0D6X-pTDLODFAnCX3IlqdV1OL02tlq0ZjHbqx8nzg,7439
76
76
  ai_edge_quantizer/utils/validation_utils_test.py,sha256=T8K5mCWeMcihND2KS_dHvCJUU9lEdG2sD95EgPkaX3w,5584
77
- ai_edge_quantizer_nightly-0.5.0.dev20260103.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
78
- ai_edge_quantizer_nightly-0.5.0.dev20260103.dist-info/METADATA,sha256=gJG1WQM6zOnsWl8Fp3axH3YydN3szFTS6qZ05biDrXw,1729
79
- ai_edge_quantizer_nightly-0.5.0.dev20260103.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
80
- ai_edge_quantizer_nightly-0.5.0.dev20260103.dist-info/top_level.txt,sha256=8QTfPnFXNVUhScFLaa-NWZMFWMn72M50DVPubpwWB1g,18
81
- ai_edge_quantizer_nightly-0.5.0.dev20260103.dist-info/RECORD,,
77
+ ai_edge_quantizer_nightly-0.5.0.dev20260112.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
78
+ ai_edge_quantizer_nightly-0.5.0.dev20260112.dist-info/METADATA,sha256=9m2IZe6HAZtu2zhhOej5CbUIB2OiyQTlCCCJzBvk6Es,1729
79
+ ai_edge_quantizer_nightly-0.5.0.dev20260112.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
80
+ ai_edge_quantizer_nightly-0.5.0.dev20260112.dist-info/top_level.txt,sha256=8QTfPnFXNVUhScFLaa-NWZMFWMn72M50DVPubpwWB1g,18
81
+ ai_edge_quantizer_nightly-0.5.0.dev20260112.dist-info/RECORD,,