Args: ds (DataFlow): input DataFlow. shuffle (bool): whether to shuffle the cache before yielding from it.
(self, ds, shuffle=False)
| 674 | Otherwise the cache may be incomplete. |
| 675 | """ |
| 676 | def __init__(self, ds, shuffle=False): |
| 677 | """ |
| 678 | Args: |
| 679 | ds (DataFlow): input DataFlow. |
| 680 | shuffle (bool): whether to shuffle the cache before yielding from it. |
| 681 | """ |
| 682 | self.shuffle = shuffle |
| 683 | super(CacheData, self).__init__(ds) |
| 684 | |
| 685 | def reset_state(self): |
| 686 | super(CacheData, self).reset_state() |