|
|
@ -151,7 +151,7 @@ class TestDataLoaderWorkerLoop(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
|
|
def run_with_worker_done(self, use_shared_memory=True):
|
|
|
|
def run_with_worker_done(self, use_shared_memory=True):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
place = fluid.cpu_places()[0]
|
|
|
|
place = fluid.CUDAPlace(0)
|
|
|
|
with fluid.dygraph.guard(place):
|
|
|
|
with fluid.dygraph.guard(place):
|
|
|
|
dataset = RandomDataset(800)
|
|
|
|
dataset = RandomDataset(800)
|
|
|
|
|
|
|
|
|
|
|
@ -190,7 +190,8 @@ class TestDataLoaderWorkerLoop(unittest.TestCase):
|
|
|
|
self.assertTrue(False)
|
|
|
|
self.assertTrue(False)
|
|
|
|
|
|
|
|
|
|
|
|
def test_main(self):
|
|
|
|
def test_main(self):
|
|
|
|
for use_shared_memory in [True, False]:
|
|
|
|
# only HACK a subprocess call here, do not need to use_shared_memory
|
|
|
|
|
|
|
|
for use_shared_memory in [False]:
|
|
|
|
self.run_without_worker_done(use_shared_memory)
|
|
|
|
self.run_without_worker_done(use_shared_memory)
|
|
|
|
self.run_with_worker_done(use_shared_memory)
|
|
|
|
self.run_with_worker_done(use_shared_memory)
|
|
|
|
|
|
|
|
|
|
|
|