def __init__(self, collection=None):
        """
        Args:
            collection (str): collection of ops to run. Defaults to ``tf.GraphKeys.UPDATE_OPS``
        """
        if collection is None:
            collection = tf.GraphKeys.UPDATE_OPS
        name = 'UPDATE_OPS' if collection == tf.GraphKeys.UPDATE_OPS else collection

        def f():
            ops = tf.get_collection(collection)
            if ops:
                logger.info("Applying collection {} of {} ops.".format(name, len(ops)))
                return tf.group(*ops, name='update_ops')
            else:
                return tf.no_op(name='empty_update_ops')

        super(RunUpdateOps, self).__init__(
            f, run_before=False, run_as_trigger=False, run_step=True)
def __init__ ( self , collection = None ) : if collection is None : collection = tf . GraphKeys . UPDATE_OPS name = 'UPDATE_OPS' if collection == tf . GraphKeys . UPDATE_OPS else collection def f ( ) : ops = tf . get_collection ( collection ) if ops : logger . info ( "Applying collection {} of {} ops." . format ( name , len ( ops ) ) ) return tf . group ( * ops , name = 'update_ops' ) else : return tf . no_op ( name = 'empty_update_ops' ) super ( RunUpdateOps , self ) . __init__ ( f , run_before = False , run_as_trigger = False , run_step = True )
Args:
            collection (str): collection of ops to run. Defaults to ``tf.GraphKeys.UPDATE_OPS``