Skip to content

Commit 6a8aa76

Browse files
evcutensorflower-gardener
authored andcommitted
Internal change
PiperOrigin-RevId: 466955128
1 parent 9131a7a commit 6a8aa76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorflow_model_optimization/python/core/sparsity/keras/pruning_impl.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def _update_mask(self, weights):
9090
"""
9191
sparsity = self._pruning_schedule(self._step_fn())[1]
9292
with tf.name_scope('pruning_ops'):
93-
abs_weights = tf.math.abs(weights)
93+
# abs_weights = tf.math.abs(weights)
94+
abs_weights = tf.random.uniform(weights.shape, dtype=weights.dtype)
9495
k = tf.dtypes.cast(
9596
tf.math.maximum(
9697
tf.math.round(

0 commit comments

Comments
 (0)