import tensorflow as tf


    def _mark_for_monitoring(self, name, value):
        tf.add_to_collection(TF_COLLECTION_MONITORED, tf.identity(value, name))

    def _add_monitoring_of_values(self):
        monitored_values = tf.get_collection(TF_COLLECTION_MONITORED)
        monitored_values = {
            value.name.split(':')[0]: value # Get rid of ':0' from name
            for value in monitored_values
        }

        for (name, value) in monitored_values.items():
            tf.summary.scalar(name, value)

        summary_op = tf.summary.merge_all()

        return (summary_op, monitored_values)

    def _make_var(self, name, shape, dtype=None, no_reg=False, initializer=None, init_constant=None, trainable=True):
        if initializer is None:
            if init_constant is not None:
                initializer = tf.constant_initializer(init_constant, dtype=tf.float32)
            else:
                initializer = tf.contrib.keras.initializers.he_normal()
