예제 #1
0
    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)))
예제 #2
0
  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)))