diff --git a/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_mkldnn_op.py b/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_mkldnn_op.py index 82fb2ca0c40d53eec79bf1244d0b8dffbe3454b8..e070f5fbbe057f3290ddb8d2d04d579c98107512 100644 --- a/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_mkldnn_op.py +++ b/python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_mkldnn_op.py @@ -156,6 +156,14 @@ class TestWithStride(TestConv2dMKLDNNOp): class TestWithGroup(TestConv2dMKLDNNOp): + def init_test_case(self): + self.pad = [0, 0] + self.stride = [1, 1] + self.input_size = [2, 6, 5, 5] # NCHW + assert np.mod(self.input_size[1], self.groups) == 0 + f_c = self.input_size[1] // self.groups + self.filter_size = [6, f_c, 3, 3] + def init_group(self): self.groups = 3 @@ -163,13 +171,13 @@ class TestWithGroup(TestConv2dMKLDNNOp): class TestWith1x1(TestConv2dMKLDNNOp): def init_test_case(self): TestConv2dMKLDNNOp.init_test_case(self) - self.filter_size = [6, 3, 1, 1] + self.filter_size = [40, 3, 1, 1] class TestWithInput1x1Filter1x1(TestConv2dMKLDNNOp): def init_test_case(self): TestConv2dMKLDNNOp.init_test_case(self) - self.input_size = [2, 3, 1, 1] # NCHW + self.input_size = [2, 60, 1, 1] # NCHW assert np.mod(self.input_size[1], self.groups) == 0 f_c = self.input_size[1] // self.groups self.filter_size = [6, f_c, 1, 1] diff --git a/python/paddle/fluid/tests/unittests/mkldnn/test_transpose_mkldnn_op.py b/python/paddle/fluid/tests/unittests/mkldnn/test_transpose_mkldnn_op.py index d0fe1f94c670f9bf89cb8f8c0d882184fa54cb53..0d670898dd76e808bee631d4330046235e3cc104 100644 --- a/python/paddle/fluid/tests/unittests/mkldnn/test_transpose_mkldnn_op.py +++ b/python/paddle/fluid/tests/unittests/mkldnn/test_transpose_mkldnn_op.py @@ -60,13 +60,13 @@ class TestCase0MKLDNN(TestTransposeMKLDNN): class TestCase1a(TestTransposeMKLDNN): def initTestCase(self): - self.shape = (3, 4, 5) + self.shape = (3, 4, 10) self.axis = (0, 2, 1) class TestCase1b(TestTransposeMKLDNN): def initTestCase(self): - self.shape = (3, 4, 5) + self.shape = (3, 4, 10) self.axis = (2, 1, 0) diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py b/python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py index f578f3bdfb301dccc888b83ce63e273353a53773..ed804d701a84b1c52d7efd539eba59e5c1f9f7e3 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py +++ b/python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py @@ -194,7 +194,7 @@ class TestSeqProjectCase1(TestSeqProject): self.padding_trainable = True self.context_stride = 1 - self.input_size = [self.input_row, 23] + self.input_size = [self.input_row, 50] offset_lod = [[0, 4, 5, 8, self.input_row]] self.lod = [[]] # convert from offset-based lod to length-based lod @@ -211,7 +211,7 @@ class TestSeqProjectCase2Len0(TestSeqProject): self.padding_trainable = True self.context_stride = 1 - self.input_size = [self.input_row, 23] + self.input_size = [self.input_row, 50] offset_lod = [[0, 0, 4, 5, 5, 8, self.input_row, self.input_row]] self.lod = [[]] # convert from offset-based lod to length-based lod @@ -228,7 +228,7 @@ class TestSeqProjectCase3(TestSeqProject): self.padding_trainable = True self.context_stride = 1 - self.input_size = [self.input_row, 23] + self.input_size = [self.input_row, 25] idx = list(range(self.input_size[0])) del idx[0] offset_lod = [[0] + np.sort(random.sample(idx, 8)).tolist() + diff --git a/python/paddle/fluid/tests/unittests/test_concat_op.py b/python/paddle/fluid/tests/unittests/test_concat_op.py index 11574637a8dc0efcf4db843b27f8218fc086a075..f7ac868552fd47dd7988cfdd0cf740d2c9efb4fa 100644 --- a/python/paddle/fluid/tests/unittests/test_concat_op.py +++ b/python/paddle/fluid/tests/unittests/test_concat_op.py @@ -51,9 +51,9 @@ class TestConcatOp(OpTest): self.check_grad(['x2'], 'Out') def init_test_data(self): - self.x0 = np.random.random((2, 1, 4, 5)).astype(self.dtype) - self.x1 = np.random.random((2, 2, 4, 5)).astype(self.dtype) - self.x2 = np.random.random((2, 3, 4, 5)).astype(self.dtype) + self.x0 = np.random.random((5, 1, 4, 5)).astype(self.dtype) + self.x1 = np.random.random((5, 2, 4, 5)).astype(self.dtype) + self.x2 = np.random.random((5, 3, 4, 5)).astype(self.dtype) self.axis = 1 @@ -94,9 +94,9 @@ class TestConcatOp4(TestConcatOp): class TestConcatOp5(TestConcatOp): def init_test_data(self): - self.x0 = np.random.random((2, 1, 4, 5)).astype(self.dtype) - self.x1 = np.random.random((2, 2, 4, 5)).astype(self.dtype) - self.x2 = np.random.random((2, 3, 4, 5)).astype(self.dtype) + self.x0 = np.random.random((5, 1, 4, 5)).astype(self.dtype) + self.x1 = np.random.random((5, 2, 4, 5)).astype(self.dtype) + self.x2 = np.random.random((5, 3, 4, 5)).astype(self.dtype) self.axis = -3 diff --git a/python/paddle/fluid/tests/unittests/test_deformable_conv_v1_op.py b/python/paddle/fluid/tests/unittests/test_deformable_conv_v1_op.py index 5646f72f7297485855b8d65d98a94f6709712563..2f950b53e0cadb0b15e404facc57b0d498f3ff32 100644 --- a/python/paddle/fluid/tests/unittests/test_deformable_conv_v1_op.py +++ b/python/paddle/fluid/tests/unittests/test_deformable_conv_v1_op.py @@ -198,7 +198,7 @@ class TestWithDilation(TestModulatedDeformableConvOp): def init_test_case(self): self.pad = [2, 2] self.stride = [1, 1] - self.input_size = [2, 3, 4, 4] # NCHW + self.input_size = [5, 3, 4, 4] # NCHW assert np.mod(self.input_size[1], self.groups) == 0 f_c = self.input_size[1] // self.groups self.filter_size = [6, f_c, 3, 3] @@ -221,7 +221,7 @@ class TestWith1x1(TestModulatedDeformableConvOp): self.input_size = [2, 3, 5, 5] # NCHW assert np.mod(self.input_size[1], self.groups) == 0 f_c = self.input_size[1] // self.groups - self.filter_size = [6, f_c, 1, 1] + self.filter_size = [40, f_c, 1, 1] self.im2col_step = 1 self.deformable_groups = 1 offset_c = 2 * self.deformable_groups * self.filter_size[ @@ -232,6 +232,22 @@ class TestWith1x1(TestModulatedDeformableConvOp): class TestWithGroup(TestModulatedDeformableConvOp): + def init_test_case(self): + self.pad = [1, 1] + self.stride = [1, 1] + self.dilations = [1, 1] + self.input_size = [2, 8, 4, 4] # NCHW + assert np.mod(self.input_size[1], self.groups) == 0 + f_c = self.input_size[1] // self.groups + self.filter_size = [4, f_c, 3, 3] + self.im2col_step = 1 + self.deformable_groups = 1 + offset_c = 2 * self.deformable_groups * self.filter_size[ + 2] * self.filter_size[3] + self.offset_size = [ + self.input_size[0], offset_c, self.input_size[2], self.input_size[3] + ] + def init_group(self): self.groups = 2 diff --git a/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py b/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py index c6e05edfaaec216627225cd85b472ef5bda4dee7..eda530f30df26a80ec9b0f46d876b71f2818859f 100755 --- a/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py +++ b/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py @@ -377,7 +377,7 @@ class TestNearestInterpOp_attr_tensor(OpTest): def init_test_case(self): self.interp_method = 'nearest' - self.input_shape = [2, 3, 4, 4] + self.input_shape = [2, 5, 4, 4] self.out_h = 3 self.out_w = 3 self.scale = 0.