import tensorflow as tf

        # overall pruning ratios of trainable & maskable variables
        pr_trainable = calc_prune_ratio(self.trainable_vars)
        pr_maskable = calc_prune_ratio(self.maskable_vars)
        tf.summary.scalar('pr_trainable', pr_trainable)
        tf.summary.scalar('pr_maskable', pr_maskable)

        # build masks and corresponding operations for weight sparsification
        self.masks, self.prune_op = self.__build_masks()

        # optimizer & gradients
        optimizer_base = tf.train.MomentumOptimizer(lrn_rate, FLAGS.momentum)
        if not FLAGS.enbl_multi_gpu:
          optimizer = optimizer_base
        else:
          optimizer = mgw.DistributedOptimizer(optimizer_base)
        grads_origin = optimizer.compute_gradients(loss, self.trainable_vars)
        grads_pruned = self.__calc_grads_pruned(grads_origin)

      # TF operations & model saver
      self.sess_train = sess
