All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nd4j.linalg.ops.reduceops.scalarops.Sum Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.nd4j.linalg.ops.reduceops.scalarops;

import org.nd4j.linalg.api.ndarray.INDArray;

/**
 * Sum over an ndarray
 *
 * @author Adam Gibson
 */
public class Sum extends BaseScalarOp {

    public Sum() {
        super(0);
    }

    @Override
    public double accumulate(INDArray arr, int i, double soFar) {
        return arr.getDouble(i) + soFar;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy