TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
pytorch_quantization.tensor_quant.FakeAffineTensorQuantFunction Class Reference
Inheritance diagram for pytorch_quantization.tensor_quant.FakeAffineTensorQuantFunction:
Collaboration diagram for pytorch_quantization.tensor_quant.FakeAffineTensorQuantFunction:

Static Public Member Functions

def forward (ctx, inputs, min_range, max_range, num_bits=8)
 
def backward (ctx, grad_outputs)
 

Detailed Description

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.

Member Function Documentation

◆ forward()

def pytorch_quantization.tensor_quant.FakeAffineTensorQuantFunction.forward (   ctx,
  inputs,
  min_range,
  max_range,
  num_bits = 8 
)
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

◆ backward()

def pytorch_quantization.tensor_quant.FakeAffineTensorQuantFunction.backward (   ctx,
  grad_outputs 
)
static
Args:
    ctx: Pytorch convention.
    grad_output: A tensor of gradient of outputs

Returns:
    grad_inputs: A tensor of gradient

The documentation for this class was generated from the following file: