(self)
| 47 | assert qp.dtype == quantization_config.q_dtype |
| 48 | |
| 49 | def test_hf_clone(self): |
| 50 | device = get_accelerator().current_device_name() |
| 51 | data = torch.rand(5, 5, device=device, dtype=torch.bfloat16) |
| 52 | |
| 53 | quantization_config = QuantizationConfig(q_bits=6) |
| 54 | qp = QuantizedParameter(data, quantization_config=quantization_config) |
| 55 | |
| 56 | # should be able to clone parameter via dict, HF expects this to work |
| 57 | qp_copy = QuantizedParameter(qp.data, **qp.__dict__) |
| 58 | |
| 59 | assert all(qp.data == qp_copy.data) |
| 60 | assert qp.quantization_config == qp_copy.quantization_config |
nothing calls this directly
no test coverage detected