From 01cf8e893f25671f8c7a5862402fcf9d404bb0d4 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Wed, 8 Jul 2020 11:38:39 +0800 Subject: [PATCH] fix test_multiprocess_dataloader_exception failed on CPU-only version (#25406) * fix test_multiprocess_dataloader_exception failed on CPU only version. test=develop --- .../tests/unittests/test_multiprocess_dataloader_exception.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py index 6b1300cf93d..617527242f5 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_exception.py @@ -23,6 +23,7 @@ import multiprocessing import numpy as np import paddle.fluid as fluid +import paddle.fluid.core as core from paddle.io import Dataset, BatchSampler, DataLoader from paddle.fluid.dygraph.nn import Linear from paddle.fluid.dygraph.base import to_variable @@ -109,6 +110,8 @@ class TestDataLoaderAssert(unittest.TestCase): # CI Converage cannot record stub in subprocess, # HACK a _worker_loop in main process call here +@unittest.skipIf(not core.is_compiled_with_cuda(), + "core is not compiled with CUDA") class TestDataLoaderWorkerLoop(unittest.TestCase): def run_without_worker_done(self, use_shared_memory=True): try: -- GitLab