Perform dequantization on the quantized Tensor `input`.
Given quantized `input` which was quantized using `scales` and `zero_points`, performs dequantization using the formula: dequantized_data = (quantized_data - zero_point) * scale.
Nested Classes
class | UniformDequantize.Options | Optional attributes for UniformDequantize
|
Public Methods
Output<U> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <U extends Number, T> UniformDequantize<U> | |
Output<U> |
output()
The output dequantized Tensor of Tout, whose shape is same as input.
|
static UniformDequantize.Options |
quantizationAxis(Long quantizationAxis)
|
Inherited Methods
Public Methods
public Output<U> asOutput ()
Returns the symbolic handle of a tensor.
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
public static UniformDequantize<U> create (Scope scope, Operand<T> input, Operand<Float> scales, Operand<Integer> zeroPoints, Class<U> Tout, Long quantizationMinVal, Long quantizationMaxVal, Options... options)
Factory method to create a class wrapping a new UniformDequantize operation.
Parameters
scope | current scope |
---|---|
input | Must be a Tensor of Tin. |
scales | The float value(s) used as scale(s) when quantizing original data that input represents. Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). |
zeroPoints | The int32 value(s) used as zero_point(s) when quantizing original data that input represents. Same shape condition as scales. |
Tout | The type of output Tensor. A tf.DType from: tf.qint8, tf.qint32 |
quantizationMinVal | The quantization min value that was used when input was quantized. The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: `(Tin lowest) + 1` if narrow range, and `(Tin lowest)` otherwise. For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. |
quantizationMaxVal | The quantization max value that was used when input was quantized. The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: `(Tout max)` for both narrow range and not narrow range. For example, if Tin is qint8, this is set to 127. |
options | carries optional attributes values |
Returns
- a new instance of UniformDequantize
public static UniformDequantize.Options quantizationAxis (Long quantizationAxis)
Parameters
quantizationAxis | Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). |
---|