Static Public Member Functions | |
def | forward (ctx, inputs, min_range, max_range, num_bits=8) |
def | backward (ctx, grad_outputs) |
Fake version of affine quantization gemmlowp style scale+shift quantization. See more details in https://github.com/google/gemmlowp/blob/master/doc/quantization.md. We DO NOT recommend affine quantization on weights for performance reason. There might be value to affine quantize activation as it can be cancelled by bias and comes with no performance penalty. This functionality is only added for experimental purpose.
|
static |
As it will be only applied on activation with per tensor granularity, broadcast is not needed. Args: ctx: Pytorch convention. inputs: A Tensor of type float32. min_range: A float. max_range: A float. num_bits: An integer Returns: outputs: A Tensor of type output_dtype
|
static |
Args: ctx: Pytorch convention. grad_output: A tensor of gradient of outputs Returns: grad_inputs: A tensor of gradient