aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/quantize
diff options
context:
space:
mode:
authorGravatar Suharsh Sivakumar <suharshs@google.com>2018-04-06 17:51:40 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-06 18:23:08 -0700
commit12576beec31ae0d73cce8f96e418e628a0c01654 (patch)
treef7eda293a741364371bec024d55d8d32fc0e6fd3 /tensorflow/contrib/quantize
parentc7c108bfca264aa82a01f0c30d4db386f8e20bff (diff)
We no longer need updates_collections in quant ops since we rely on the data dependency from Assign ops.
PiperOrigin-RevId: 191965466
Diffstat (limited to 'tensorflow/contrib/quantize')
-rw-r--r--tensorflow/contrib/quantize/python/quant_ops.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/tensorflow/contrib/quantize/python/quant_ops.py b/tensorflow/contrib/quantize/python/quant_ops.py
index a4f7b1b221..5c0e17dc86 100644
--- a/tensorflow/contrib/quantize/python/quant_ops.py
+++ b/tensorflow/contrib/quantize/python/quant_ops.py
@@ -51,7 +51,6 @@ def LastValueQuantize(inputs,
per_channel=False,
init_min=-6.0,
init_max=6.0,
- updates_collection=ops.GraphKeys.UPDATE_OPS,
vars_collection=ops.GraphKeys.MOVING_AVERAGE_VARIABLES,
name_prefix='LastValueQuant',
reuse=None,
@@ -69,8 +68,6 @@ def LastValueQuantize(inputs,
quantization ranges per output channel.
init_min: a float scalar, the initial value for variable min.
init_max: a float scalar, the initial value for variable max.
- updates_collection: (Optional) collections to collect the update ops for
- computation.
vars_collection: (Optional) collection where to store variables for
quantization interval ends.
name_prefix: name_prefix for created nodes.
@@ -133,7 +130,6 @@ def LastValueQuantize(inputs,
# TFLite requires that 0.0 if always in the [min; max] range.
batch_min = math_ops.minimum(batch_min, 0.0)
assign_min = state_ops.assign(min_var, batch_min, name='AssignMinLast')
- ops.add_to_collection(updates_collection, assign_min.op)
if per_channel:
if input_dim >= 2:
@@ -146,7 +142,6 @@ def LastValueQuantize(inputs,
# TFLite requires that 0.0 if always in the [min; max] range.
batch_max = math_ops.maximum(batch_max, 0.0)
assign_max = state_ops.assign(max_var, batch_max, name='AssignMaxLast')
- ops.add_to_collection(updates_collection, assign_max.op)
return _FakeQuantWithMinMaxVars(
inputs,
@@ -163,7 +158,6 @@ def MovingAvgQuantize(inputs,
init_min=-6.0,
init_max=6.0,
ema_decay=0.999,
- updates_collection=ops.GraphKeys.UPDATE_OPS,
vars_collection=ops.GraphKeys.MOVING_AVERAGE_VARIABLES,
name_prefix='MovingAvgQuantize',
reuse=None,
@@ -182,8 +176,6 @@ def MovingAvgQuantize(inputs,
init_min: a float scalar, the initial value for variable min.
init_max: a float scalar, the initial value for variable max.
ema_decay: EMA decay parameter.
- updates_collection: (Optional) collections to collect the update ops for
- computation.
vars_collection: (Optional) collection where to store variables for
quantization interval ends.
name_prefix: name_prefix for created nodes.
@@ -246,7 +238,6 @@ def MovingAvgQuantize(inputs,
batch_min = math_ops.minimum(batch_min, 0.0)
assign_min = moving_averages.assign_moving_average(
min_var, batch_min, ema_decay, name='AssignMinEma')
- ops.add_to_collection(updates_collection, assign_min.op)
if per_channel:
if input_dim >= 2:
@@ -260,7 +251,6 @@ def MovingAvgQuantize(inputs,
batch_max = math_ops.maximum(batch_max, 0.0)
assign_max = moving_averages.assign_moving_average(
max_var, batch_max, ema_decay, name='AssignMaxEma')
- ops.add_to_collection(updates_collection, assign_max.op)
return _FakeQuantWithMinMaxVars(
inputs,