Skip to content

Commit

Permalink
Insert retry
Browse files Browse the repository at this point in the history
  • Loading branch information
unnonouno committed Aug 26, 2017
1 parent 919f584 commit 8b5bc2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/chainer_tests/test_gradient_check.py
Expand Up @@ -329,6 +329,7 @@ def backward(self, inputs, grads):
}))
class TestCheckBackward(unittest.TestCase):

@condition.retry(3)
def test_multiple_output(self):
x1 = numpy.array([1], dtype='f')
x2 = numpy.array([1], dtype='f')
Expand All @@ -342,6 +343,7 @@ def f(x, y):

gradient_check.check_backward(f, (x1, x2), (g1, g2), dtype=self.dtype)

@condition.retry(3)
def test_no_grads_for_not_float(self):
x1 = numpy.array([1], dtype='f')
x2 = numpy.array([0, 1], dtype='i') # grad check for this is skipped
Expand All @@ -351,8 +353,9 @@ def f(x, y):
s = Ident()(x)
return s,

gradient_check.check_backward(f, (x1, x2), g1, dtype='d')
gradient_check.check_backward(f, (x1, x2), g1, dtype=self.dtype)

@condition.retry(3)
def test_no_grads_option(self):
x1 = numpy.array([1], dtype='f')
x2 = numpy.array([1], dtype='f') # grad check for this is skipped
Expand Down

0 comments on commit 8b5bc2f

Please sign in to comment.