Versioned name: FakeQuantize-1
Category: Quantization
Short description: FakeQuantize is element-wise linear quantization of floating-point input values into a discrete set of floating-point values.
Detailed description: Input and output ranges as well as the number of levels of quantization are specified by dedicated inputs and attributes. There can be different limits for each element or groups of elements (channels) of the input tensors. Otherwise, one limit applies to all elements. It depends on shape of inputs that specify limits and regular broadcasting rules applied for input tensors. The output of the operator is a floating-point number of the same type as the input tensor. In general, there are four values that specify quantization for each element: input_low, input_high, output_low, output_high. input_low and input_high attributes specify the input range of quantization. All input values that are outside this range are clipped to the range before actual quantization. output_low and output_high specify minimum and maximum quantized values at the output.
Fake in FakeQuantize means the output tensor is of the same floating point type as an input tensor, not integer type.
Each element of the output is defined as the result of the following expression:
Attributes
int
Inputs:
X
- multidimensional input tensor of floating type to be quantized. Required.input_low
- minimum limit for input value. The shape must be broadcastable to the shape of X. Required.input_high
- maximum limit for input value. Can be the same as input_low
for binarization. The shape must be broadcastable to the shape of X. Required.output_low
- minimum quantized value. The shape must be broadcastable to the shape of X. Required.output_high
- maximum quantized value. The shape must be broadcastable to the of X. Required.Inputs:
Y
- resulting tensor with shape and type matching the 1st input tensor X.Example