python/ray/tune/tests/test_sync.py
def testNoSyncToDriver(self):
        """Test that sync to driver is disabled"""

        class _Trial:
            def __init__(self, id, logdir):
                self.id = (id,)
                self.logdir = logdir

        trial = _Trial("0", "some_dir")

        sync_config = tune.SyncConfig(syncer=None)

        # Create syncer callbacks
        callbacks = create_default_callbacks([], sync_config, loggers=None)
        syncer_callback = callbacks[-1]

        # Sanity check that we got the syncer callback
        self.assertTrue(isinstance(syncer_callback, SyncerCallback))

        # Sync function should be false (no sync to driver)
        self.assertEqual(syncer_callback._sync_function, False)

        # Sync to driver is disabled, so this should be no-op
        trial_syncer = syncer_callback._get_trial_syncer(trial)
        self.assertEqual(trial_syncer.sync_client, NOOP)
Test that sync to driver is disabled
Test that sync to driver is disabled
Test that sync to driver is disabled
def testNoSyncToDriver(self):
        class _Trial:
            def __init__(self, id, logdir):
                self.id = (id,)
                self.logdir = logdir
        trial = _Trial("0", "some_dir")
        sync_config = tune.SyncConfig(syncer=None)
        callbacks = create_default_callbacks([], sync_config, loggers=None)
        syncer_callback = callbacks[-1]
        self.assertTrue(isinstance(syncer_callback, SyncerCallback))
        self.assertEqual(syncer_callback._sync_function, False)
        trial_syncer = syncer_callback._get_trial_syncer(trial)
        self.assertEqual(trial_syncer.sync_client, NOOP)
def testNoSyncToDriver ( self ) : class _Trial : def __init__ ( self , id , logdir ) : self . id = ( id , ) self . logdir = logdir trial = _Trial ( "0" , "some_dir" ) sync_config = tune . SyncConfig ( syncer = None ) callbacks = create_default_callbacks ( [ ] , sync_config , loggers = None ) syncer_callback = callbacks [ - 1 ] self . assertTrue ( isinstance ( syncer_callback , SyncerCallback ) ) self . assertEqual ( syncer_callback . _sync_function , False ) trial_syncer = syncer_callback . _get_trial_syncer ( trial ) self . assertEqual ( trial_syncer . sync_client , NOOP )
Test that sync to driver is disabled
Test that sync to driver is disabled
"""Test that sync to driver is disabled""" # Create syncer callbacks # Sanity check that we got the syncer callback # Sync function should be false (no sync to driver) # Sync to driver is disabled, so this should be no-op
self