import tensorflow as tf

        num_params = 0
        # utils.logger.log('Model parameters:')
        for var in tf_trainable_vars:
            # utils.logger.log(str(var))
            num_params += np.prod([dim.value for dim in var.get_shape()])

        utils.logger.log('Model has {} parameters'.format(num_params))
        return num_params

    def _add_vars_assign_op(self, vars):
        var_phs = {
            tf_var.name: tf.placeholder(dtype=tf_var.dtype, shape=tf_var.shape)
            for tf_var in vars
        }
        vars_assign_op = tf.group([
            tf.assign(tf_var, ph)
            for (tf_var, ph) in zip(vars, var_phs.values())
        ], name='vars_assign_op')

        return (var_phs, vars_assign_op)

    ####################################
