Skip to content

Commit ed4c405

Browse files
authored
Update README.md (#649)
1 parent 7f0621d commit ed4c405

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

torchao/quantization/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ import pickle
4949
import torchao.quantization
5050

5151
# After the first forward pass (when quantization was done)
52+
from torchao.quantization.autoquant import AUTOQUANT_CACHE
5253
with open("quantization-cache.pkl", "wb") as f:
53-
pickle.dump(torchao.quantization.AUTOQUANT_CACHE)
54+
pickle.dump(AUTOQUANT_CACHE)
5455

5556
# On load
57+
from torchao.quantization.autoquant import AUTOQUANT_CACHE
5658
with open("quantization-cache.pkl", "rb") as f:
57-
torchao.quantization.AUTOQUANT_CACHE.update(pickle.load(f))
59+
AUTOQUANT_CACHE.update(pickle.load(f))
5860
```
5961
## Affine Quantization
6062
Affine quantization refers to the type of quantization that maps from floating point numbers to quantized numbers (typically integer) with an affine transformation, i.e.: `quantized_val = float_val / scale + zero_point` where `scale` and `zero_point` are quantization parameters for some granularity and based on some data.

0 commit comments

Comments
 (0)