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

Method dequeue

tensorflow/python/ops/data_flow_ops.py:422–458  ·  view source on GitHub ↗

Dequeues one element from this queue. If the queue is empty when this operation executes, it will block until there is an element to dequeue. At runtime, this operation may raise an error if the queue is `tf.QueueBase.close` before or during its execution. If the queue is close

(self, name=None)

Source from the content-addressed store, hash-verified

420 return tensors
421
422 def dequeue(self, name=None):
423 """Dequeues one element from this queue.
424
425 If the queue is empty when this operation executes, it will block
426 until there is an element to dequeue.
427
428 At runtime, this operation may raise an error if the queue is
429 `tf.QueueBase.close` before or during its execution. If the
430 queue is closed, the queue is empty, and there are no pending
431 enqueue operations that can fulfill this request,
432 `tf.errors.OutOfRangeError` will be raised. If the session is
433 `tf.Session.close`,
434 `tf.errors.CancelledError` will be raised.
435
436 Args:
437 name: A name for the operation (optional).
438
439 Returns:
440 The tuple of tensors that was dequeued.
441 """
442 if name is None:
443 name = "%s_Dequeue" % self._name
444 if self._queue_ref.dtype == _dtypes.resource:
445 ret = gen_data_flow_ops.queue_dequeue_v2(
446 self._queue_ref, self._dtypes, name=name)
447 else:
448 ret = gen_data_flow_ops.queue_dequeue(
449 self._queue_ref, self._dtypes, name=name)
450
451 # NOTE(mrry): Not using a shape function because we need access to
452 # the `QueueBase` object.
453 if not context.executing_eagerly():
454 op = ret[0].op
455 for output, shape in zip(op.values(), self._shapes):
456 output.set_shape(shape)
457
458 return self._dequeue_return_value(ret)
459
460 def dequeue_many(self, n, name=None):
461 """Dequeues and concatenates `n` elements from this queue.

Callers 15

input_datasetMethod · 0.45
takeMethod · 0.45
test_simpleMethod · 0.45
test_shuffleMethod · 0.45
test_slicesMethod · 0.45
worker_fnMethod · 0.45
save_restore_fnMethod · 0.45
restore_fnMethod · 0.45

Calls 4

_dequeue_return_valueMethod · 0.95
executing_eagerlyMethod · 0.80
valuesMethod · 0.45
set_shapeMethod · 0.45

Tested by 15

test_simpleMethod · 0.36
test_shuffleMethod · 0.36
test_slicesMethod · 0.36
worker_fnMethod · 0.36
save_restore_fnMethod · 0.36
restore_fnMethod · 0.36
testMetricsCollectionMethod · 0.36
fMethod · 0.36
testBasicFunctionMethod · 0.36