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

org.nd4j.linalg.ops.ElementWiseOpCompose Maven / Gradle / Ivy

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Aggregation of element wise operations
 *
 * @author Adam Gibson
 */
public class ElementWiseOpCompose {
    private List opsToExecute = new ArrayList<>();
    private boolean reverse = false;

    public ElementWiseOpCompose op(ElementWiseOp op) {
        opsToExecute.add(op);
        return this;
    }


    public void exec() {
        if(reverse)
            Collections.reverse(opsToExecute);


        for(ElementWiseOp op : opsToExecute)
            op.exec();

    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy