Exemple #1
0
 def forward(self, input):
     out = torch.fbgemm_linear_int8_weight_fp32_activation(
         input.float(), self.weight, self.packed_tensor_ptr,
         self.col_offsets, self.scale, self.zero_point, self.bias)
     return out.to(input.dtype)
Exemple #2
0
 def fbgemm_quantized_linear(input, weight, bias):
     return torch.fbgemm_linear_int8_weight_fp32_activation(
         input.float(), q_weight, packed_weight, col_offsets, scale,
         zero_point, bias.float())