quantizers 1.2.0__tar.gz → 1.2.2__tar.gz

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.
Files changed (51) hide show
  1. {quantizers-1.2.0/src/quantizers.egg-info → quantizers-1.2.2}/PKG-INFO +2 -2
  2. {quantizers-1.2.0 → quantizers-1.2.2}/pyproject.toml +2 -2
  3. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/_version.py +2 -2
  4. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/fixed_point/_fixed_point_ops.py +2 -2
  5. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/fixed_point/fixed_point_ops_np.py +1 -1
  6. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/stateful_quantizers.py +3 -3
  7. {quantizers-1.2.0 → quantizers-1.2.2/src/quantizers.egg-info}/PKG-INFO +2 -2
  8. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers.egg-info/requires.txt +1 -1
  9. {quantizers-1.2.0 → quantizers-1.2.2}/test/test_stateless_quantizer.py +1 -1
  10. {quantizers-1.2.0 → quantizers-1.2.2}/.clang-format +0 -0
  11. {quantizers-1.2.0 → quantizers-1.2.2}/.github/workflows/python-publish.yml +0 -0
  12. {quantizers-1.2.0 → quantizers-1.2.2}/.github/workflows/python-test.yml +0 -0
  13. {quantizers-1.2.0 → quantizers-1.2.2}/.gitignore +0 -0
  14. {quantizers-1.2.0 → quantizers-1.2.2}/.pre-commit-config.yaml +0 -0
  15. {quantizers-1.2.0 → quantizers-1.2.2}/LICENSE +0 -0
  16. {quantizers-1.2.0 → quantizers-1.2.2}/README.md +0 -0
  17. {quantizers-1.2.0 → quantizers-1.2.2}/setup.cfg +0 -0
  18. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/__init__.py +0 -0
  19. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/binary/__init__.py +0 -0
  20. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/binary/_binary_ops.py +0 -0
  21. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/binary/binary_ops.py +0 -0
  22. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/binary/binary_ops_np.py +0 -0
  23. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/fixed_point/__init__.py +0 -0
  24. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/fixed_point/fixed_point_ops.py +0 -0
  25. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/minifloat/__init__.py +0 -0
  26. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/minifloat/_float_point_ops.py +0 -0
  27. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/minifloat/float_point_ops.py +0 -0
  28. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers/minifloat/float_point_ops_np.py +0 -0
  29. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers.egg-info/SOURCES.txt +0 -0
  30. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers.egg-info/dependency_links.txt +0 -0
  31. {quantizers-1.2.0 → quantizers-1.2.2}/src/quantizers.egg-info/top_level.txt +0 -0
  32. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_binary.h +0 -0
  33. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_common.h +0 -0
  34. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_decl.h +0 -0
  35. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_fixed.h +0 -0
  36. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_fixed_base.h +0 -0
  37. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_fixed_ref.h +0 -0
  38. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_fixed_special.h +0 -0
  39. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_float.h +0 -0
  40. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_int.h +0 -0
  41. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_int_base.h +0 -0
  42. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_int_ref.h +0 -0
  43. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_int_special.h +0 -0
  44. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/ap_shift_reg.h +0 -0
  45. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/etc/ap_private.h +0 -0
  46. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/hls_math.h +0 -0
  47. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/hls_stream.h +0 -0
  48. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/test.cpp +0 -0
  49. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/ap_types/utils/x_hls_utils.h +0 -0
  50. {quantizers-1.2.0 → quantizers-1.2.2}/test/cpp_source/quantizers.h +0 -0
  51. {quantizers-1.2.0 → quantizers-1.2.2}/test/test_quantizer_match.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantizers
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Author-email: Chang Sun <chsun@cern.ch>
5
5
  License: GNU Lesser General Public License v3 (LGPLv3)
6
6
  Project-URL: repository, https://github.com/calad0i/quantizers
@@ -15,7 +15,7 @@ License-File: LICENSE
15
15
  Provides-Extra: dependencies
16
16
  Requires-Dist: numpy; extra == "dependencies"
17
17
  Provides-Extra: grad
18
- Requires-Dist: keras>=3; extra == "grad"
18
+ Requires-Dist: keras>=3.10; extra == "grad"
19
19
  Provides-Extra: test
20
20
  Requires-Dist: pytest; extra == "test"
21
21
  Requires-Dist: pytest-cov; extra == "test"
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "quantizers"
8
- version = "1.2.0"
8
+ version = "1.2.2"
9
9
  authors = [{ name = "Chang Sun", email = "chsun@cern.ch" }]
10
10
  description = ""
11
11
  readme = "README.md"
@@ -36,7 +36,7 @@ write_to = "src/quantizers/_version.py"
36
36
  [project.optional-dependencies]
37
37
  dependencies = ["numpy"]
38
38
 
39
- grad = ['keras>=3']
39
+ grad = ['keras>=3.10']
40
40
  test = [
41
41
  'pytest',
42
42
  'pytest-cov',
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '1.2.0'
21
- __version_tuple__ = version_tuple = (1, 2, 0)
20
+ __version__ = version = '1.2.2'
21
+ __version_tuple__ = version_tuple = (1, 2, 2)
@@ -3,7 +3,7 @@ from functools import wraps
3
3
  from typing import Any, TypeVar
4
4
 
5
5
  from keras import ops
6
- from keras.api.random import SeedGenerator
6
+ from keras.random import SeedGenerator
7
7
  from numpy.typing import ArrayLike
8
8
 
9
9
  round_mode_registry: dict[str, Callable[[Any], Any]] = {}
@@ -124,7 +124,7 @@ def wrap_sm_fn(x, k, i, f, training=None, quant_fn: Callable = lambda x: x):
124
124
  eps = 2.0**-f
125
125
  high = 2.0**i - eps
126
126
  low = -(high + eps) * k
127
- interval = 2 ** (i + k)
127
+ interval = 2.0 ** (i + k)
128
128
  c1 = ((x) / interval) % 2 >= 1 # type: ignore
129
129
  c1 = c1 & (ops.abs(x) > eps / 2)
130
130
  c2 = ((x + eps / 2) / (interval / 2)) % 2 >= 1 # type: ignore
@@ -117,7 +117,7 @@ def wrap_sm_fn(x, k, i, f, training=None, quant_fn: Callable = lambda x: x):
117
117
  eps = 2.0**-f
118
118
  high = 2.0**i - eps
119
119
  low = -(high + eps) * k
120
- interval = 2 ** (i + k)
120
+ interval = 2.0 ** (i + k)
121
121
  c1 = ((x) / interval) % 2 >= 1
122
122
  c1 = c1 & (np.abs(x) > eps / 2)
123
123
  c2 = ((x + eps / 2) / (interval / 2)) % 2 >= 1
@@ -87,11 +87,11 @@ class FixedQ:
87
87
  def __call__(self, x):
88
88
  use_numpy = not is_tensor(x)
89
89
  k, i, f = self.signed, self.integer - self.signed, self.width - self.integer
90
- k, i, f = float(k), float(i), float(f)
90
+ # k, i, f = float(k), float(i), float(f)
91
91
  if use_numpy:
92
92
  q = get_fixed_quantizer_np(self.rounding, self.overflow)
93
93
  else:
94
- from keras.api import ops
94
+ from keras import ops
95
95
 
96
96
  k, i, f = ops.convert_to_tensor(k), ops.convert_to_tensor(i), ops.convert_to_tensor(f)
97
97
  q = get_fixed_quantizer(self.rounding, self.overflow)
@@ -131,7 +131,7 @@ class MinifloatQ:
131
131
  if use_numpy:
132
132
  return float_quantize_np(x, s, e, e0)
133
133
  else:
134
- from keras.api import ops
134
+ from keras import ops
135
135
 
136
136
  s, e, e0 = ops.convert_to_tensor(s), ops.convert_to_tensor(e), ops.convert_to_tensor(e0)
137
137
  return float_quantize(x, s, e, e0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantizers
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Author-email: Chang Sun <chsun@cern.ch>
5
5
  License: GNU Lesser General Public License v3 (LGPLv3)
6
6
  Project-URL: repository, https://github.com/calad0i/quantizers
@@ -15,7 +15,7 @@ License-File: LICENSE
15
15
  Provides-Extra: dependencies
16
16
  Requires-Dist: numpy; extra == "dependencies"
17
17
  Provides-Extra: grad
18
- Requires-Dist: keras>=3; extra == "grad"
18
+ Requires-Dist: keras>=3.10; extra == "grad"
19
19
  Provides-Extra: test
20
20
  Requires-Dist: pytest; extra == "test"
21
21
  Requires-Dist: pytest-cov; extra == "test"
@@ -3,7 +3,7 @@
3
3
  numpy
4
4
 
5
5
  [grad]
6
- keras>=3
6
+ keras>=3.10
7
7
 
8
8
  [test]
9
9
  pytest
@@ -4,7 +4,7 @@ import jax
4
4
  import jax.numpy as jnp
5
5
  import numpy as np
6
6
  import pytest
7
- from keras.api.random import SeedGenerator
7
+ from keras.random import SeedGenerator
8
8
 
9
9
  from quantizers import (
10
10
  binary_quantize,
File without changes
File without changes
File without changes
File without changes
File without changes