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,
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.
# 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:
# 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,
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,
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.
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:
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,