import tensorflow as tf

        # record pruning masks & operations
        masks += [mask]
        prune_ops += [prune_op]

    return masks, tf.group(prune_ops)

  def __calc_prune_ratio_dyn(self, prune_ratio_fnl):
    """Calculate the dynamic pruning ratio.
