From 33138a421d72912d0b51ddaf9d1e32f0c8b808d5 Mon Sep 17 00:00:00 2001 From: sneaxiy Date: Tue, 5 Mar 2019 11:32:23 +0000 Subject: [PATCH] remove match check test=develop --- paddle/fluid/operators/controlflow/while_op_helper.cc | 3 --- .../fluid/tests/unittests/test_eager_deletion_while_op.py | 6 +++--- .../unittests/test_partial_eager_deletion_transformer.py | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/operators/controlflow/while_op_helper.cc b/paddle/fluid/operators/controlflow/while_op_helper.cc index 0324a1586a0..848ff5e8f14 100644 --- a/paddle/fluid/operators/controlflow/while_op_helper.cc +++ b/paddle/fluid/operators/controlflow/while_op_helper.cc @@ -241,9 +241,6 @@ static void PrepareSafeEagerDeletionOnWhileOpAndWhileGradOpImpl( ModifyWhileOpAndWhileGradOpAttr(*matched_fwd_op, bwd_op); while_op_set.erase(*matched_fwd_op); } - - PADDLE_ENFORCE(while_op_set.empty(), - "There are not matched while_grad op in graph."); } void PrepareSafeEagerDeletionOnWhileOpAndWhileGradOp( diff --git a/python/paddle/fluid/tests/unittests/test_eager_deletion_while_op.py b/python/paddle/fluid/tests/unittests/test_eager_deletion_while_op.py index 7fa1636579e..898d04ebe1c 100644 --- a/python/paddle/fluid/tests/unittests/test_eager_deletion_while_op.py +++ b/python/paddle/fluid/tests/unittests/test_eager_deletion_while_op.py @@ -47,7 +47,7 @@ class TestEagerDeletionWhileOpBase(unittest.TestCase): self.with_data_parallel = with_data_parallel if not core.is_compiled_with_cuda() and isinstance(self.place, - core.CUDPlace): + core.CUDAPlace): return if isinstance(self.place, core.CUDAPlace): @@ -55,8 +55,8 @@ class TestEagerDeletionWhileOpBase(unittest.TestCase): ) if self.with_data_parallel else 1 else: device_cnt = int( - os.environ['CPU_NUM'], - multiprocessing.cpu_count()) if self.with_data_parallel else 1 + os.environ.get('CPU_NUM', multiprocessing.cpu_count( + ))) if self.with_data_parallel else 1 d0 = layers.data( "d0", shape=[10], append_batch_size=False, dtype='float32') diff --git a/python/paddle/fluid/tests/unittests/test_partial_eager_deletion_transformer.py b/python/paddle/fluid/tests/unittests/test_partial_eager_deletion_transformer.py index d44e4627d8e..ba3b275c7e8 100644 --- a/python/paddle/fluid/tests/unittests/test_partial_eager_deletion_transformer.py +++ b/python/paddle/fluid/tests/unittests/test_partial_eager_deletion_transformer.py @@ -18,7 +18,7 @@ os.environ['FLAGS_eager_delete_tensor_gb'] = "0.0" os.environ['FLAGS_memory_fraction_of_eager_deletion'] = "0.55" os.environ[ - 'RECORDIO_FILENAME'] = '/tmp/eager_deletion_transformer.wmt16.recordio' + 'RECORDIO_FILENAME'] = '/tmp/partial_eager_deletion_transformer.wmt16.recordio' from test_parallel_executor_transformer import TestTransformer -- GitLab