Return a tensor containing the dequantized weights of this parameter.
(self)
| 65 | assert tensor.dtype == self.quantization_config.q_dtype |
| 66 | |
| 67 | def dequantized(self) -> torch.Tensor: |
| 68 | """ |
| 69 | Return a tensor containing the dequantized weights of this parameter. |
| 70 | """ |
| 71 | if get_accelerator().on_accelerator(self.data) and self.data.dtype == self.quantization_config.q_dtype: |
| 72 | with get_accelerator().stream(get_accelerator().current_stream(self.data.device)): |
| 73 | return self.quantizer.dequantize(self.data, |
| 74 | q_bits=self.quantization_config.q_bits, |
| 75 | q_mantisa_bits=self.quantization_config.mantissa_bits) |
| 76 | return self.data |
| 77 | |
| 78 | def offload(self, revert=False): |
| 79 | if getattr(self, 'ds_offload', False): |
no test coverage detected