Class Batching

java.lang.Object
com.itextpdf.pdfocr.onnxtr.util.Batching

public final class Batching extends Object
Static utility class to help with batching.
  • Method Details

    • wrap

      public static  Iterator<List> wrap (Iterator iterator, int batchSize)
      Wraps an existing iterator into a new one, which output List-based batches,
      Type Parameters:
      E - input iterator element type
      Parameters:
      iterator - iterator to wrap
      batchSize - target batch size. Last batch might have smaller size
      Returns:
      batch iterator wrapper