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

org.nd4j.linalg.api.ops.aggregates.Aggregate Maven / Gradle / Ivy

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

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

import java.util.List;

/**
 * Aggregates are ops that work with custom operands, that are not limited to traditional X, Y and Z constraints.
 *
 * @author [email protected]
 */
public interface Aggregate {

    String name();

    int opNum();


    void setFinalResult(Number result);

    Number getFinalResult();

    List getArguments();

    List getShapes();

    List getIndexingArguments();

    List getRealArguments();

    List getIntArrayArguments();

    /*
       Methods related to batch memory manipulations
     */

    /**
     * This method returns maximum number of shapes being passed per Aggregate
     *
     * @return
     */
    int maxArguments();

    /**
     * This method returns maximum number of shapes being passed per Aggregate
     *
     * @return
     */
    int maxShapes();

    /**
     * This method returns maximum number of IntArrays being passed per Aggregate
     *
     * @return
     */
    int maxIntArrays();

    /**
     * This method returns maximum length for IntArrays, if any
     *
     * @return
     */
    int maxIntArraySize();

    /**
     * This method returns maximum number of IndexArguments per Aggregate
     *
     * @return
     */
    int maxIndexArguments();

    /**
     * This method returns maximum number of real (float/double) per Aggregate
     *
     * @return
     */
    int maxRealArguments();

    /**
     * This method returns amount of memory required for batch creation for this specific Aggregate
     * @return
     */
    long getRequiredBatchMemorySize();

    /**
     * This method returns amount of shared memory required for this specific Aggregate.
     * PLEASE NOTE: this method is especially important for CUDA backend. On CPU backend it might be ignored, depending on Aggregate.
     *
     * @return
     */
    int getSharedMemorySize();

    /**
     * This method returns desired number of threads per Aggregate instance
     * PLEASE NOTE: this method is especially important for CUDA backend. On CPU backend it might be ignored, depending on Aggregate.
     *
     * @return
     */
    int getThreadsPerInstance();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy