package org.deeplearning4j.spark.impl.common;

import org.apache.spark.api.java.function.VoidFunction;
import org.nd4j.linalg.api.ndarray.INDArray;


/**
 * @author Adam Gibson
 */
public class Adder implements VoidFunction<INDArray> {
    private SumAccum accumulator;

    public Adder(int length) {
        accumulator = new SumAccum(length);
    }

    @Override
    public void call(INDArray indArrayIterator) throws Exception {
        accumulator.add(indArrayIterator);
    }

    public SumAccum getAccumulator() {
        return accumulator;
    }

    public void setAccumulator(SumAccum accumulator) {
        this.accumulator = accumulator;
    }
}

@@ -141,16 +141,73 @@
 DArray;%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 %0A%0A/**%0A *
@@ -319,16 +319,86 @@
 mulator;
+%0A    private static Logger log = LoggerFactory.getLogger(Adder.class);
 %0A%0A    pu
@@ -566,42 +566,132 @@
     
-accumulator.add(indArrayIterator);
+log.info(%22Invoking add operation %22);%0A        accumulator.add(indArrayIterator);%0A        log.info(%22Invoked add operation %22);%0A
 %0A   

change accumulation strategy