Creates a generator to extract data from the queue. Skip the data if it is `None`. Yields: The next element in the queue, i.e. a tuple `(inputs, targets)` or `(inputs, targets, sample_weights)`.
(self)
| 769 | self._send_sequence() # Update the pool |
| 770 | |
| 771 | def get(self): |
| 772 | """Creates a generator to extract data from the queue. |
| 773 | |
| 774 | Skip the data if it is `None`. |
| 775 | |
| 776 | Yields: |
| 777 | The next element in the queue, i.e. a tuple |
| 778 | `(inputs, targets)` or |
| 779 | `(inputs, targets, sample_weights)`. |
| 780 | """ |
| 781 | try: |
| 782 | while self.is_running(): |
| 783 | inputs = self.queue.get(block=True).get() |
| 784 | self.queue.task_done() |
| 785 | if inputs is not None: |
| 786 | yield inputs |
| 787 | except Exception: # pylint: disable=broad-except |
| 788 | self.stop() |
| 789 | six.reraise(*sys.exc_info()) |
| 790 | |
| 791 | |
| 792 | def init_pool_generator(gens, random_seed=None, id_queue=None): |