def create_batches(self): if self.sort_in_buckets: return BucketIterator.create_batches(self) else: return Iterator.create_batches(self)