mirror of
https://github.com/huggingface/candle.git
synced 2025-06-15 18:28:24 +00:00
Support for quantized tensors in the python api. (#706)
* Add more pyo3 support. * Add some support for quantized tensors in pyo3. * Add an arc layer on qmatmul. * Add the quantized matmul. * Quantization support. * More quantization support. * Test the python quantization.
This commit is contained in:
@ -33,3 +33,9 @@ print(t.to_dtype("u8"))
|
||||
t = candle.randn((5, 3))
|
||||
print(t)
|
||||
print(t.dtype)
|
||||
|
||||
t = candle.randn((16, 256))
|
||||
quant_t = t.quantize("q6k")
|
||||
dequant_t = quant_t.dequantize()
|
||||
diff2 = (t - dequant_t).sqr()
|
||||
print(diff2.mean_all())
|
||||
|
Reference in New Issue
Block a user