From 8b5bc2f2f82777476c69bd3dc1255b499ae77fc1 Mon Sep 17 00:00:00 2001 From: Yuya Unno Date: Sat, 26 Aug 2017 14:23:37 +0900 Subject: [PATCH] Insert retry --- tests/chainer_tests/test_gradient_check.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/chainer_tests/test_gradient_check.py b/tests/chainer_tests/test_gradient_check.py index 6de8c9ee61e2..5f87a562a2f4 100644 --- a/tests/chainer_tests/test_gradient_check.py +++ b/tests/chainer_tests/test_gradient_check.py @@ -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') @@ -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 @@ -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