import tensorflow as tf


        # 2nd part of minimize: apply_gradient
        optimizer_step = self._optimizer.apply_gradients(clipped_grads_and_vars, global_step=self.global_step)

        update_ops = tf.group(*self.update_ops)
        self.training_op = tf.group(update_ops, optimizer_step)


    def set_check_ops(self):
        self._check_ops = 1

        # TODO argo2 This is not working anymore with the new session
        #with self.sess.graph.as_default():
        self._numerics_ops = tf.add_check_numerics_ops()

    def release(self):
        super().release()
        self.sess.close()
        tf.reset_default_graph()

    def set_summaries(self):
        """This function sets summaries and summaryFileWriters, it needs to be invoked before
        training to keep track of the summaries.
        (cannot be invoked in create_and_init_network because the FileWriter will corrupt data in the logfolder
        at each initialization)
        """
