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

Method test_string

tensorflow/python/ops/prefetch_test.py:57–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 11

request_stopMethod · 0.95
CoordinatorMethod · 0.80
as_defaultMethod · 0.45
GraphMethod · 0.45
deviceMethod · 0.45
constantMethod · 0.45
finalizeMethod · 0.45
test_sessionMethod · 0.45
after_create_sessionMethod · 0.45
decodeMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected