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

Method input_producer

tensorflow/python/ops/work_queue.py:401–424  ·  view source on GitHub ↗

Returns a FIFOQueue as input producer. Returns: A local queue of work items. A `QueueRunner` for the Queue is added to the current `Graph`'s `QUEUE_RUNNER` collection.

(self)

Source from the content-addressed store, hash-verified

399 return string_ops.string_join([self._prefix, local_work])
400
401 def input_producer(self):
402 """Returns a FIFOQueue as input producer.
403
404 Returns:
405 A local queue of work items. A `QueueRunner` for the Queue
406 is added to the current `Graph`'s `QUEUE_RUNNER` collection.
407 """
408 work = self.take()
409 with ops.name_scope(self.name):
410 with ops.device(self._local_device):
411 proxy = data_flow_ops.FIFOQueue(
412 capacity=1,
413 dtypes=[dtypes.string],
414 shapes=[tensor_shape.TensorShape([1])],
415 name='proxy')
416 with ops.control_dependencies(
417 [logging_ops.print_v2("Take work:", work)]):
418 work = array_ops.identity(work)
419 enqueue_proxy = proxy.enqueue(array_ops.reshape(work, (1,)))
420 cancel_proxy = proxy.close(cancel_pending_enqueues=True)
421 proxy_runner = queue_runner.QueueRunner(
422 proxy, [enqueue_proxy], cancel_op=cancel_proxy)
423 queue_runner.add_queue_runner(proxy_runner)
424 return proxy
425
426 def input_dataset(self):
427 """Returns a dataset as input dataset

Callers 11

input_datasetMethod · 0.95
test_simpleMethod · 0.95
test_shuffleMethod · 0.95
test_slicesMethod · 0.95
worker_fnMethod · 0.95
save_restore_fnMethod · 0.95
restore_fnMethod · 0.95
testNoShuffleMethod · 0.80
testNoShapeInferenceMethod · 0.80
testShapeErrorMethod · 0.80

Calls 10

takeMethod · 0.95
FIFOQueueMethod · 0.80
reshapeMethod · 0.80
QueueRunnerMethod · 0.80
closeMethod · 0.65
name_scopeMethod · 0.45
deviceMethod · 0.45
control_dependenciesMethod · 0.45
identityMethod · 0.45
enqueueMethod · 0.45

Tested by 10

test_simpleMethod · 0.76
test_shuffleMethod · 0.76
test_slicesMethod · 0.76
worker_fnMethod · 0.76
save_restore_fnMethod · 0.76
restore_fnMethod · 0.76
testNoShuffleMethod · 0.64
testNoShapeInferenceMethod · 0.64
testShapeErrorMethod · 0.64