From d72604cd46037a10ad61bd58b47bad091cfe99fd Mon Sep 17 00:00:00 2001 From: Bai Yifan Date: Mon, 14 Dec 2020 20:19:57 +0800 Subject: [PATCH] fix unittst unstable issue on ci machine (#29588) * fix unittst unstable issue on ci machine * fix unittst unstable issue on ci machine * fix unittst unstable issue on ci machine --- .../fluid/tests/unittests/test_deform_conv2d.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_deform_conv2d.py b/python/paddle/fluid/tests/unittests/test_deform_conv2d.py index 660625c9bf7..dc57e87f940 100644 --- a/python/paddle/fluid/tests/unittests/test_deform_conv2d.py +++ b/python/paddle/fluid/tests/unittests/test_deform_conv2d.py @@ -22,11 +22,11 @@ from unittest import TestCase class TestDeformConv2D(TestCase): batch_size = 4 - spatial_shape = (16, 16) + spatial_shape = (5, 5) dtype = "float32" def setUp(self): - self.in_channels = 3 + self.in_channels = 2 self.out_channels = 5 self.kernel_size = [3, 3] self.padding = [0, 0] @@ -36,6 +36,8 @@ class TestDeformConv2D(TestCase): self.no_bias = True def prepare(self): + np.random.seed(1) + paddle.seed(1) if isinstance(self.kernel_size, int): filter_shape = (self.kernel_size, ) * 2 else: @@ -182,11 +184,11 @@ class TestDeformConv2D(TestCase): class TestDeformConv2DFunctional(TestCase): batch_size = 4 - spatial_shape = (16, 16) + spatial_shape = (5, 5) dtype = "float32" def setUp(self): - self.in_channels = 3 + self.in_channels = 2 self.out_channels = 5 self.kernel_size = [3, 3] self.padding = [0, 0] @@ -196,6 +198,8 @@ class TestDeformConv2DFunctional(TestCase): self.no_bias = True def prepare(self): + np.random.seed(1) + paddle.seed(1) if isinstance(self.kernel_size, int): filter_shape = (self.kernel_size, ) * 2 else: -- GitLab