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

Method dequeue_many

tensorflow/python/ops/data_flow_ops.py:460–501  ·  view source on GitHub ↗

Dequeues and concatenates `n` elements from this queue. This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. All of the components in the dequeued tuple will have size `n` in the 0th dimension. If the queue is close

(self, n, name=None)

Source from the content-addressed store, hash-verified

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.
462
463 This operation concatenates queue-element component tensors along
464 the 0th dimension to make a single component tensor. All of the
465 components in the dequeued tuple will have size `n` in the 0th dimension.
466
467 If the queue is closed and there are less than `n` elements left, then an
468 `OutOfRange` exception is raised.
469
470 At runtime, this operation may raise an error if the queue is
471 `tf.QueueBase.close` before or during its execution. If the
472 queue is closed, the queue contains fewer than `n` elements, and
473 there are no pending enqueue operations that can fulfill this
474 request, `tf.errors.OutOfRangeError` will be raised. If the
475 session is `tf.Session.close`,
476 `tf.errors.CancelledError` will be raised.
477
478 Args:
479 n: A scalar `Tensor` containing the number of elements to dequeue.
480 name: A name for the operation (optional).
481
482 Returns:
483 The list of concatenated tensors that was dequeued.
484 """
485 if name is None:
486 name = "%s_DequeueMany" % self._name
487
488 ret = gen_data_flow_ops.queue_dequeue_many_v2(
489 self._queue_ref, n=n, component_types=self._dtypes, name=name)
490
491 # NOTE(mrry): Not using a shape function because we need access to
492 # the Queue object.
493 if not context.executing_eagerly():
494 op = ret[0].op
495 batch_dim = tensor_shape.Dimension(
496 tensor_util.constant_value(op.inputs[1]))
497 for output, shape in zip(op.values(), self._shapes):
498 output.set_shape(
499 tensor_shape.TensorShape([batch_dim]).concatenate(shape))
500
501 return self._dequeue_return_value(ret)
502
503 def dequeue_up_to(self, n, name=None):
504 """Dequeues and concatenates `n` elements from this queue.

Callers 15

_fnMethod · 0.80
testArrayFeedingMethod · 0.80
testPandasFeedingMethod · 0.80
_fnMethod · 0.80
_generator_input_fnFunction · 0.80
_get_workersFunction · 0.80
testEmptyDequeueManyMethod · 0.80

Calls 6

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

Tested by 15

_fnMethod · 0.64
testArrayFeedingMethod · 0.64
testPandasFeedingMethod · 0.64
_fnMethod · 0.64
_get_workersFunction · 0.64
testEmptyDequeueManyMethod · 0.64
testDequeueManyMethod · 0.64
testMultiDequeueManyMethod · 0.64
testHighDimensionMethod · 0.64