(self)
| 111 | return self |
| 112 | |
| 113 | def store_parameter_value(self): |
| 114 | for var, _ in zip(self.inputs + self.outputs, |
| 115 | self.config.input_quantization_config + self.config.output_quantization_config): |
| 116 | if var.is_parameter: |
| 117 | assert isinstance(var, QuantableVariable), 'Unexpected error.' |
| 118 | # convert var.value to torch.Tensor |
| 119 | # notice here we set device = None, this conversion will not change var.value.device anyway. |
| 120 | # so that we can use var.value.device as a deploy device for stored_value |
| 121 | var.stored_value = convert_any_to_torch_tensor(var.value, device='cpu').clone() |
| 122 | return self |
| 123 | |
| 124 | def dequantize(self, parameter_only: bool = False, expire_device: str = 'cpu'): |
| 125 | if self._dequantized: return self |
no test coverage detected