From ea9d6731dc255b8400a603aaf3489f6e029e5e4d Mon Sep 17 00:00:00 2001 From: Krzysztof Binias Date: Fri, 1 Mar 2019 12:57:35 +0100 Subject: [PATCH] Add test for ceil mode test=develop --- .../unittests/mkldnn/test_pool2d_mkldnn_op.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/python/paddle/fluid/tests/unittests/mkldnn/test_pool2d_mkldnn_op.py b/python/paddle/fluid/tests/unittests/mkldnn/test_pool2d_mkldnn_op.py index 6de43dd46e5..feb2a563eea 100644 --- a/python/paddle/fluid/tests/unittests/mkldnn/test_pool2d_mkldnn_op.py +++ b/python/paddle/fluid/tests/unittests/mkldnn/test_pool2d_mkldnn_op.py @@ -18,6 +18,24 @@ import unittest from paddle.fluid.tests.unittests.test_pool2d_op import TestPool2D_Op, TestCase1, TestCase2, TestCase3, TestCase4, TestCase5 +def create_test_mkldnn_use_ceil_class(parent): + class TestMKLDNNPool2DUseCeilCase(parent): + def init_kernel_type(self): + self.use_mkldnn = True + + def init_ceil_mode(self): + self.ceil_mode = True + + cls_name = "{0}_{1}".format(parent.__name__, "MKLDNNCeilModeCast") + TestMKLDNNPool2DUseCeilCase.__name__ = cls_name + globals()[cls_name] = TestMKLDNNPool2DUseCeilCase + + +create_test_mkldnn_use_ceil_class(TestPool2D_Op) +create_test_mkldnn_use_ceil_class(TestCase1) +create_test_mkldnn_use_ceil_class(TestCase2) + + def create_test_mkldnn_class(parent): class TestMKLDNNCase(parent): def init_kernel_type(self): -- GitLab