model_fp32_prepared(input_fp32)# Convert the observed model to a quantized model. This does several things:# quantizes the weights, computes and stores the scale and bias value to be# used with each activation tensor, and replaces key operators with quantized# implementations.model_int8 = t...
if init_weights: self._initialize_weights() def forward(self,x): x = self.quant(x) x = self.features(x) x = self.avgpool(x) x = torch.flatten(x,start_dim=1) # x = x.mean([2, 3]) x = self.classifier(x) x = self.dequant(x) return x def _initialize_weights(self): ...