MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / test_simple

Method test_simple

tensorflow/python/ops/work_queue_test.py:60–84  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 force_gpu_compatible=True))
59
60 def test_simple(self):
61 with self.test_session():
62 works = [b"to", b"be", b"or", b"not", b"to", b"be"]
63 num_epochs = 3
64 work_queue = WorkQueue(works, num_epochs=num_epochs, shuffle=False)
65
66 local_queue = work_queue.input_producer()
67 dequeue = local_queue.dequeue()
68 dequeue_many = local_queue.dequeue_many(len(works) * num_epochs)
69
70 resources.initialize_resources(resources.shared_resources()).run()
71 variables.global_variables_initializer().run()
72 variables.local_variables_initializer().run()
73 threads = queue_runner_impl.start_queue_runners()
74
75 local_works = dequeue_many.eval().tolist()
76 self.assertEqual(
77 works * num_epochs,
78 [item for work in local_works for item in work])
79
80 # Reached the limit.
81 with self.assertRaises(errors_impl.OutOfRangeError):
82 dequeue.eval()
83 for thread in threads:
84 thread.join()
85
86 def test_shuffle(self):
87 with self.test_session():

Callers

nothing calls this directly

Calls 9

input_producerMethod · 0.95
WorkQueueClass · 0.90
dequeue_manyMethod · 0.80
test_sessionMethod · 0.45
dequeueMethod · 0.45
runMethod · 0.45
start_queue_runnersMethod · 0.45
evalMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected