python/ray/tune/tests/test_ray_trial_executor.py
def testResetTrial(self):
        """Tests that reset works as expected."""

        class B(Trainable):
            def step(self):
                return dict(timesteps_this_iter=1, done=True)

            def reset_config(self, config):
                self.config = config
                return True

        trials = self.generate_trials(
            {
                "run": B,
                "config": {"foo": 0},
            },
            "grid_search",
        )
        trial = trials[0]
        self._simulate_starting_trial(trial)
        exists = self.trial_executor.reset_trial(trial, {"hi": 1}, "modified_mock")
        self.assertEqual(exists, True)
        self.assertEqual(trial.config.get("hi"), 1)
        self.assertEqual(trial.experiment_tag, "modified_mock")
        self.assertEqual(Trial.RUNNING, trial.status)
Tests that reset works as expected.
Tests that reset works as expected.
Tests that reset works as expected .
def testResetTrial(self):
        class B(Trainable):
            def step(self):
                return dict(timesteps_this_iter=1, done=True)
            def reset_config(self, config):
                self.config = config
                return True
        trials = self.generate_trials(
            {
                "run": B,
                "config": {"foo": 0},
            },
            "grid_search",
        )
        trial = trials[0]
        self._simulate_starting_trial(trial)
        exists = self.trial_executor.reset_trial(trial, {"hi": 1}, "modified_mock")
        self.assertEqual(exists, True)
        self.assertEqual(trial.config.get("hi"), 1)
        self.assertEqual(trial.experiment_tag, "modified_mock")
        self.assertEqual(Trial.RUNNING, trial.status)
def testResetTrial ( self ) : class B ( Trainable ) : def step ( self ) : return dict ( timesteps_this_iter = 1 , done = True ) def reset_config ( self , config ) : self . config = config return True trials = self . generate_trials ( { "run" : B , "config" : { "foo" : 0 } , } , "grid_search" , ) trial = trials [ 0 ] self . _simulate_starting_trial ( trial ) exists = self . trial_executor . reset_trial ( trial , { "hi" : 1 } , "modified_mock" ) self . assertEqual ( exists , True ) self . assertEqual ( trial . config . get ( "hi" ) , 1 ) self . assertEqual ( trial . experiment_tag , "modified_mock" ) self . assertEqual ( Trial . RUNNING , trial . status )
Tests that reset works as expected.
Tests that reset works as expected .
"""Tests that reset works as expected."""
self