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)
| 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 |