Commit c5076b6
committed
Implement _dequantize for TorchAO quantizer
- Add _dequantize() method in TorchAoHfQuantizer that dequantizes
TorchAOBaseTensor weights back to standard nn.Parameter
- Fix _verify_if_layer_quantized to check isinstance(weight, TorchAOBaseTensor)
so dequantized layers are correctly detected as non-quantized1 parent c8c8401 commit c5076b6
2 files changed
Lines changed: 19 additions & 0 deletions
File tree
- src/diffusers/quantizers/torchao
- tests/models/testing_utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| 832 | + | |
| 833 | + | |
832 | 834 | | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
833 | 838 | | |
834 | 839 | | |
835 | 840 | | |
| |||
0 commit comments