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
revert-31562-mean
Bai Yifan 4 years ago committed by GitHub
parent 0034273b7e
commit d72604cd46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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:

Loading…
Cancel
Save