nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/aggregates/Batch.java
public static <U extends Aggregate> List<Batch<U>> getBatches(List<U> list, int partitionSize) {
        List<List<U>> partitions = Lists.partition(list, partitionSize);
        List<Batch<U>> split = new ArrayList<>();

        for (List<U> partition : partitions) {
            split.add(new Batch<U>(partition));
        }

        return split;
    }
public static <U extends Aggregate> List<Batch<U>> getBatches(List<U> list, int partitionSize) {
        List<List<U>> partitions = Lists.partition(list, partitionSize);
        List<Batch<U>> split = new ArrayList<>();

        for (List<U> partition : partitions) {
            split.add(new Batch<U>(partition));
        }

        return split;
    }
public static < U extends Aggregate > List < Batch < U > > getBatches ( List < U > list , int partitionSize ) { List < List < U >> partitions = Lists . partition ( list , partitionSize ) ; List < Batch < U > > split = new ArrayList <> ( ) ; for ( List < U > partition : partitions ) { split . add ( new Batch < U > ( partition ) ) ; } return split ; }
Helper method to create batch from list of aggregates, for cases when list of aggregates is higher then batchLimit

@param list
@param <U>
@return
Helper method to create batch from list of aggregates for cases when list of aggregates is higher then batchLimit