Esempio n. 1
0
    def test_on_backward(self):
        def example(state):
            return state

        state = 'test'
        self.assertTrue(
            callbacks.on_backward(example).on_backward(state) == state)
Esempio n. 2
0
 def test_multi(self):
     def example(state):
         return state
     state = 'test'
     c = callbacks.on_backward(callbacks.on_sample(callbacks.on_start(example)))
     self.assertTrue(c.on_backward(state) == state)
     self.assertTrue(c.on_sample(state) == state)
     self.assertTrue(c.on_start(state) == state)
Esempio n. 3
0
 def test_on_backward(self):
     def example(state):
         return state
     state = 'test'
     self.assertTrue(callbacks.on_backward(example).on_backward(state) == state)