aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-06-29 06:20:29 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-29 06:24:52 -0700
commitf3d5b5c0aad4e91f84800e953b8ed6c7d450d8f9 (patch)
tree5a2ce036bf835b8695c53adf27aa5c54b5aaa040
parent2345d24d3bb35df0f70090bb956eb91cb8aa6bb9 (diff)
Update ops-related pbtxt files.
PiperOrigin-RevId: 160518040
-rw-r--r--tensorflow/core/ops/compat/ops_history.v1.pbtxt47
-rw-r--r--tensorflow/core/ops/ops.pbtxt49
2 files changed, 96 insertions, 0 deletions
diff --git a/tensorflow/core/ops/compat/ops_history.v1.pbtxt b/tensorflow/core/ops/compat/ops_history.v1.pbtxt
index 9631538227..e230385c2e 100644
--- a/tensorflow/core/ops/compat/ops_history.v1.pbtxt
+++ b/tensorflow/core/ops/compat/ops_history.v1.pbtxt
@@ -16264,6 +16264,53 @@ op {
}
}
op {
+ name: "QuantizeAndDequantizeV3"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "input_min"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "input_max"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "num_bits"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "signed_input"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "range_given"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+}
+op {
name: "QuantizeDownAndShrinkRange"
input_arg {
name: "input"
diff --git a/tensorflow/core/ops/ops.pbtxt b/tensorflow/core/ops/ops.pbtxt
index 416d18a0ec..5e0a53b3b0 100644
--- a/tensorflow/core/ops/ops.pbtxt
+++ b/tensorflow/core/ops/ops.pbtxt
@@ -15499,6 +15499,55 @@ op {
description: "This op simulates the precision loss from the quantized forward pass by:\n1. Quantizing the tensor to fixed point numbers, which should match the target\n quantization method when it is used in inference.\n2. Dequantizing it back to floating point numbers for the following ops, most\n likely matmul.\n\nThere are different ways to quantize. This version does not use the full range\nof the output type, choosing to elide the lowest possible value for symmetry\n(e.g., output range is -127 to 127, not -128 to 127 for signed 8 bit\nquantization), so that 0.0 maps to 0.\n\nTo perform this op, we first find the range of values in our tensor. The range\nwe use is always centered on 0, so we find m such that\n\n1. m = max(abs(input_min), abs(input_max)) if range_given is true,\n2. m = max(abs(min_elem(input)), abs(max_elem(input))) otherwise.\n\nOur input tensor range is then [-m, m].\n\nNext, we choose our fixed-point quantization buckets, [min_fixed, max_fixed].\nIf signed_input is true, this is\n\n [min_fixed, max_fixed ] =\n [-(1 << (num_bits - 1) - 1), (1 << (num_bits - 1)) - 1].\n\nOtherwise, if signed_input is false, the fixed-point range is\n\n [min_fixed, max_fixed] = [0, (1 << num_bits) - 1].\n\nFrom this we compute our scaling factor, s:\n\n s = (max_fixed - min_fixed) / (2 * m).\n\nNow we can quantize and dequantize the elements of our tensor. An element e\nis transformed into e\':\n\n e\' = (e * s).round_to_nearest() / s.\n\nNote that we have a different number of buckets in the signed vs. unsigned\ncases. For example, if num_bits == 8, we get 254 buckets in the signed case\nvs. 255 in the unsigned case.\n\nFor example, suppose num_bits = 8 and m = 1. Then\n\n [min_fixed, max_fixed] = [-127, 127], and\n s = (127 + 127) / 2 = 127.\n\nGiven the vector {-1, -0.5, 0, 0.3}, this is quantized to\n{-127, -63, 0, 38}, and dequantized to {-1, -63.0/127, 0, 38.0/127}."
}
op {
+ name: "QuantizeAndDequantizeV3"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "input_min"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "input_max"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "num_bits"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "signed_input"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "range_given"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Quantizes then dequantizes a tensor."
+ description: "This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a\ntensor, so its value can change during training."
+}
+op {
name: "QuantizeDownAndShrinkRange"
input_arg {
name: "input"