Perform clip by value on the quantized Tensor `operand`.
Given quantized `operand` which was quantized using `scales` and `zero_points`, performs clip by value using `min` and `max` values. If quantization_axis is -1 (per-tensor quantized), the entire operand is clipped using scalar min, max. Otherwise (per-channel quantized), the clipping is also done per-channel.
Nested Classes
class | UniformQuantizedClipByValue.Options | Optional attributes for UniformQuantizedClipByValue
|
Public Methods
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T> UniformQuantizedClipByValue<T> | |
Output<T> |
output()
The output clipped Tensor of T, whose shape is same as operand.
|
static UniformQuantizedClipByValue.Options |
quantizationAxis(Long quantizationAxis)
|
Inherited Methods
Public Methods
public Output<T> 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 UniformQuantizedClipByValue<T> create (Scope scope, Operand<T> operand, Operand<T> min, Operand<T> max, Operand<Float> scales, Operand<Integer> zeroPoints, Long quantizationMinVal, Long quantizationMaxVal, Options... options)
Factory method to create a class wrapping a new UniformQuantizedClipByValue operation.
Parameters
scope | current scope |
---|---|
operand | Must be a Tensor of T. |
min | The min value(s) to clip operand. Must be a Tensor of T. Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). |
max | The min value(s) to clip operand. Must be a Tensor of T. Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). |
scales | The float value(s) used as scale(s) when quantizing `operand`, `min` and `max`. Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). |
zeroPoints | The int32 value(s) used as zero_point(s) when quantizing `operand`, `min` and `max`. Same shape condition as scales. |
quantizationMinVal | The quantization min value that was used when operand was quantized. |
quantizationMaxVal | The quantization max value that was used when operand was quantized. |
options | carries optional attributes values |
Returns
- a new instance of UniformQuantizedClipByValue
public static UniformQuantizedClipByValue.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, operand.dims()). |
---|