diff options
author | 2018-07-19 11:01:42 -0700 | |
---|---|---|
committer | 2018-07-19 11:01:42 -0700 | |
commit | 9fa89160a422433b295e22edda3776bcbc309e45 (patch) | |
tree | e9d74fcc08140ce5bc0ff784467d12b9f9dda62b /tensorflow/contrib/model_pruning/python | |
parent | 1044888430b34353f54266bf0674144dfe675687 (diff) | |
parent | 11cd70438e7d7104904bf8f3b24fcaf6fd88eab5 (diff) |
Merge pull request #19779 from Huizerd:master
PiperOrigin-RevId: 205266716
Diffstat (limited to 'tensorflow/contrib/model_pruning/python')
-rw-r--r-- | tensorflow/contrib/model_pruning/python/pruning.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/contrib/model_pruning/python/pruning.py b/tensorflow/contrib/model_pruning/python/pruning.py index 4b7af18b33..da9d398cbc 100644 --- a/tensorflow/contrib/model_pruning/python/pruning.py +++ b/tensorflow/contrib/model_pruning/python/pruning.py @@ -518,11 +518,11 @@ class Pruning(object): summary.scalar('last_mask_update_step', self._last_update_step) masks = get_masks() thresholds = get_thresholds() - for index, mask in enumerate(masks): + for mask, threshold in zip(masks, thresholds): if not self._exists_in_do_not_prune_list(mask.name): - summary.scalar(mask.name + '/sparsity', nn_impl.zero_fraction(mask)) - summary.scalar(thresholds[index].op.name + '/threshold', - thresholds[index]) + summary.scalar(mask.op.name + '/sparsity', + nn_impl.zero_fraction(mask)) + summary.scalar(threshold.op.name + '/threshold', threshold) def print_hparams(self): logging.info(self._spec.to_json()) |