Creates a `Dataset` by concatenating the given dataset with this dataset. ```python a = Dataset.range(1, 4) # ==> [ 1, 2, 3 ] b = Dataset.range(4, 8) # ==> [ 4, 5, 6, 7 ] # The input dataset and dataset to be concatenated should have the same # nested structures and output ty
(self, dataset)
| 797 | return ZipDataset(datasets) |
| 798 | |
| 799 | def concatenate(self, dataset): |
| 800 | """Creates a `Dataset` by concatenating the given dataset with this dataset. |
| 801 | |
| 802 | ```python |
| 803 | a = Dataset.range(1, 4) # ==> [ 1, 2, 3 ] |
| 804 | b = Dataset.range(4, 8) # ==> [ 4, 5, 6, 7 ] |
| 805 | |
| 806 | # The input dataset and dataset to be concatenated should have the same |
| 807 | # nested structures and output types. |
| 808 | # c = Dataset.range(8, 14).batch(2) # ==> [ [8, 9], [10, 11], [12, 13] ] |
| 809 | # d = Dataset.from_tensor_slices([14.0, 15.0, 16.0]) |
| 810 | # a.concatenate(c) and a.concatenate(d) would result in error. |
| 811 | |
| 812 | a.concatenate(b) # ==> [ 1, 2, 3, 4, 5, 6, 7 ] |
| 813 | ``` |
| 814 | |
| 815 | Args: |
| 816 | dataset: `Dataset` to be concatenated. |
| 817 | |
| 818 | Returns: |
| 819 | Dataset: A `Dataset`. |
| 820 | """ |
| 821 | return ConcatenateDataset(self, dataset) |
| 822 | |
| 823 | def prefetch(self, buffer_size): |
| 824 | """Creates a `Dataset` that prefetches elements from this dataset. |