Exemplo 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)
Exemplo 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)
Exemplo 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)