Factory function for a dataset.
()
| 1723 | # a 0-argument function. |
| 1724 | @function.Defun(capture_by_value=True, whitelisted_stateful_ops=all_ds_ops) |
| 1725 | def _make_dataset(): |
| 1726 | """Factory function for a dataset.""" |
| 1727 | # NOTE(mrry): `Defun` does not capture the graph-level seed from the |
| 1728 | # enclosing graph, so if a graph-level seed is present we set the local |
| 1729 | # graph seed based on a combination of the graph- and op-level seeds. |
| 1730 | if graph_level_seed is not None: |
| 1731 | assert op_level_seed is not None |
| 1732 | core_random_seed.set_random_seed( |
| 1733 | (graph_level_seed + 87654321 * op_level_seed) % (2 ** 63 - 1)) |
| 1734 | |
| 1735 | # TODO: DEKHTIARJonathan - Re-enable once stable. |
| 1736 | # prefetch_to_device = self.options().experimental_optimization.prefetch_to_device |
| 1737 | # if prefetch_to_device is not None: |
| 1738 | # logging.warning("GPU prefetching has been deactivated in your " |
| 1739 | # "`tf.data` pipeline. It is not compatible with " |
| 1740 | # "`tf.data.make_one_shot_iterator`. Please transition " |
| 1741 | # "to `tf.data.make_initializable_iterator` for maximum " |
| 1742 | # "performance.") |
| 1743 | # try: |
| 1744 | # options = Options() |
| 1745 | # options.experimental_optimization.prefetch_to_device = None |
| 1746 | # dataset = self.with_options(options) |
| 1747 | # except ValueError: |
| 1748 | # self._dataset._options.experimental_optimization.prefetch_to_device = None |
| 1749 | # dataset = self |
| 1750 | # else: |
| 1751 | # dataset = self |
| 1752 | dataset = self |
| 1753 | |
| 1754 | dataset = dataset._apply_options() |
| 1755 | return dataset._variant_tensor # pylint: disable=protected-access |
| 1756 | |
| 1757 | try: |
| 1758 | _make_dataset.add_to_graph(ops.get_default_graph()) |
nothing calls this directly
no test coverage detected