aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-02-28 15:02:43 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-02-28 15:34:38 -0800
commit46f5e646f4d5d524e8ebd4bf612252f31c39a986 (patch)
treee3b56a20dad8054d23401a8c5bd06933efe8b939
parent5c4df36597a2d242ffe2b241ca7147c40b0953e3 (diff)
Update ops-related pbtxt files.
Change: 148820749
-rw-r--r--tensorflow/core/ops/compat/ops_history.v1.pbtxt59
-rw-r--r--tensorflow/core/ops/ops.pbtxt11
2 files changed, 61 insertions, 9 deletions
diff --git a/tensorflow/core/ops/compat/ops_history.v1.pbtxt b/tensorflow/core/ops/compat/ops_history.v1.pbtxt
index 0061fbc078..af7d3a33e5 100644
--- a/tensorflow/core/ops/compat/ops_history.v1.pbtxt
+++ b/tensorflow/core/ops/compat/ops_history.v1.pbtxt
@@ -11122,6 +11122,65 @@ op {
}
}
op {
+ name: "QuantizeAndDequantize"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "signed_input"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "num_bits"
+ type: "int"
+ default_value {
+ i: 8
+ }
+ }
+ attr {
+ name: "range_given"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "input_min"
+ type: "float"
+ default_value {
+ f: 0
+ }
+ }
+ attr {
+ name: "input_max"
+ type: "float"
+ default_value {
+ f: 0
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ deprecation {
+ version: 22
+ }
+}
+op {
name: "QuantizeAndDequantizeV2"
input_arg {
name: "input"
diff --git a/tensorflow/core/ops/ops.pbtxt b/tensorflow/core/ops/ops.pbtxt
index 711571e8b5..897b6c0f11 100644
--- a/tensorflow/core/ops/ops.pbtxt
+++ b/tensorflow/core/ops/ops.pbtxt
@@ -12556,7 +12556,6 @@ op {
name: "QuantizeAndDequantize"
input_arg {
name: "input"
- description: "Tensor to quantize and then dequantize."
type_attr: "T"
}
output_arg {
@@ -12569,7 +12568,6 @@ op {
default_value {
b: true
}
- description: "If the quantization is signed or unsigned."
}
attr {
name: "num_bits"
@@ -12577,7 +12575,6 @@ op {
default_value {
i: 8
}
- description: "The bitwidth of the quantization."
}
attr {
name: "range_given"
@@ -12585,7 +12582,6 @@ op {
default_value {
b: false
}
- description: "If the range is given or should be computed from the tensor."
}
attr {
name: "input_min"
@@ -12593,7 +12589,6 @@ op {
default_value {
f: 0
}
- description: "If range is given, this is the min of the range."
}
attr {
name: "input_max"
@@ -12601,7 +12596,6 @@ op {
default_value {
f: 0
}
- description: "If range is given, this is the max of the range."
}
attr {
name: "T"
@@ -12613,10 +12607,9 @@ op {
}
}
}
- summary: "Quantizes then dequantizes a tensor."
- 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(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}."
+ summary: "Use QuantizeAndDequantizeV2 instead."
deprecation {
- version: 21
+ version: 22
explanation: "Replaced by QuantizeAndDequantizeV2"
}
}