def batches(self, **batches_kwargs): """Iterate over sub-batches of this batch. Args: **batches_kwargs: kwargs passed on to lib_util.batches. Yields: An iterator over sub-Batches. """ keys, values = list(zip(*list(self.features.items()))) for batch in lib_util.batches(*values, **batches_kwargs): yield Batch(**dict(lib_util.eqzip(keys, batch)))