(self)
| 55 | coord.request_stop() |
| 56 | |
| 57 | def test_string(self): |
| 58 | capacity = 3 |
| 59 | value = "'The quick brown fox jumps over the lazy dog!'" |
| 60 | with ops.Graph().as_default() as graph: |
| 61 | with ops.device('/cpu:0'): |
| 62 | x = array_ops.constant(value, dtype=dtypes.string, shape=[]) |
| 63 | with ops.device(test.gpu_device_name()): |
| 64 | y = prefetch.staged(x, capacity=capacity, num_threads=6, timeout_millis=1000) |
| 65 | |
| 66 | graph.finalize() |
| 67 | |
| 68 | with self.test_session(use_gpu=True, graph=graph) as sess: |
| 69 | coord = coordinator.Coordinator() |
| 70 | prefetch.make_prefetch_hook().after_create_session(sess, coord) |
| 71 | for _ in xrange(capacity * 3): |
| 72 | self.assertEqual(value, sess.run(y).decode()) |
| 73 | coord.request_stop() |
| 74 | |
| 75 | def test_sparse(self): |
| 76 | with ops.Graph().as_default() as graph: |
nothing calls this directly
no test coverage detected