W3cubDocs

/TensorFlow 2.4

tf.quantize_and_dequantize_v4

Returns the gradient of QuantizeAndDequantizeV4.

This is almost identical to QuantizeAndDequantizeV2, except that it returns a gradient of 1 for inputs that are within the quantization range, or 0 otherwise.

Args
input A Tensor. Must be one of the following types: bfloat16, half, float32, float64.
input_min A Tensor. Must have the same type as input.
input_max A Tensor. Must have the same type as input.
signed_input An optional bool. Defaults to True.
num_bits An optional int. Defaults to 8.
range_given An optional bool. Defaults to False.
round_mode An optional string from: "HALF_TO_EVEN", "HALF_UP". Defaults to "HALF_TO_EVEN".
narrow_range An optional bool. Defaults to False.
axis An optional int. Defaults to -1.
name A name for the operation (optional).
Returns
A Tensor. Has the same type as input.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/quantize_and_dequantize_v4