mirror of
https://github.com/huggingface/candle.git
synced 2025-06-15 18:28:24 +00:00
Make the Python Wrapper more Hackable and simplify Quantization (#1010)
* Some first `Module` implementations * Add `state_dict` and `load_state_dict` functionality * Move modules around and create `candle.nn.Linear` * Add `nn.Embedding` and `nn.LayerNorm` * Add BERT implementation * Batch q-matmul * Automatically dequantize `QTensors` if a `Tensor` is expected * Add Module `.to()`, `.cuda()`, `cpu()` and `.type()` functionality * Unittests for `Module`, `Tensor` and `candle.utils` * Add `pytorch` like slicing to `Tensor` * Cleanup and BERT fixes * `black` formatting + unit-test for `nn.Linear` * Refactor slicing implementation
This commit is contained in:
@ -7,7 +7,7 @@ print(t + t)
|
||||
|
||||
t = candle.Tensor([3.0, 1, 4, 1, 5, 9, 2, 6])
|
||||
print(t)
|
||||
print(t+t)
|
||||
print(t + t)
|
||||
|
||||
t = t.reshape([2, 4])
|
||||
print(t.matmul(t.t()))
|
||||
|
Reference in New Issue
Block a user