Sleeps for `sleep_microseconds` before producing each input element. Args: sleep_microseconds: The number of microseconds to sleep before producing an input element. Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`.
(sleep_microseconds)
| 35 | |
| 36 | |
| 37 | def sleep(sleep_microseconds): |
| 38 | """Sleeps for `sleep_microseconds` before producing each input element. |
| 39 | |
| 40 | Args: |
| 41 | sleep_microseconds: The number of microseconds to sleep before producing an |
| 42 | input element. |
| 43 | |
| 44 | Returns: |
| 45 | A `Dataset` transformation function, which can be passed to |
| 46 | `tf.data.Dataset.apply`. |
| 47 | """ |
| 48 | |
| 49 | def _apply_fn(dataset): |
| 50 | return _SleepDataset(dataset, sleep_microseconds) |
| 51 | |
| 52 | return _apply_fn |
no outgoing calls