(self, x)
| 1207 | raise NotImplementedError("Please override the `quantize_weights(self, w, outlier_idx)` function") |
| 1208 | |
| 1209 | def forward(self, x): |
| 1210 | if self.outlier_dim is None: |
| 1211 | tracer = OutlierTracer.get_instance() |
| 1212 | if not tracer.is_initialized(): |
| 1213 | logger.warning("Please use OutlierTracer.initialize(model) before using the OutlierAwareLinear layer") |
| 1214 | outlier_idx = tracer.get_outliers(self.weight) |
| 1215 | self.outlier_dim = outlier_idx |
| 1216 | |
| 1217 | if not self.is_quantized: |
| 1218 | w = self.quantize_weight(self.weight, self.outlier_dim) |
| 1219 | self.weight.data.copy_(w) |
| 1220 | self.is_quantized = True |
nothing calls this directly
no test coverage detected