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

neureka.fluent.slicing.states.AxisOrGet Maven / Gradle / Ivy

The newest version!
package neureka.fluent.slicing.states;


import neureka.Nda;
import neureka.Tensor;

/**
 *  This is the starting point of the call transition graph exposed by the slice builder API.
 *  It simply defines those method signatures which ought to be called first when using the API.
 *  This interface defines 2 transition paths, namely a route to the end of the call state graph which
 *  triggers the slicing and returns the resulting {@link Tensor} instance... or a call to
 *  the {@link FromOrAt} interface which is the starting point for slicing individual axis of a tensor...
 *
 * @param  The type parameter for items of the {@link Tensor} which ought to be sliced.
 */
public interface AxisOrGet  {

    /**
     *  Slicing a tensor ultimately means slicing one or more of its axes!
     *  This method allows one to specify which axis should be sliced next.
     *
     * @param axis The axis which ought to be sliced next.
     * @return The fluent axis slicing API.
     */
    FromOrAt axis( int axis );

    /**
     *  This method concludes the slicing API by performing the actual slicing and
     *  returning the resulting {@link Tensor} instance based on the previously
     *  specified slice configuration...
     *
     * @return A new {@link Tensor} instance which is a slice of the original tensor.
     */
    Nda get();

    /**
     *  This method concludes the slicing API by performing the actual slicing and
     *  returning the resulting {@link Tensor} instance based on the previously
     *  specified slice configuration...
     *  Contrary to the {@link #get()} method, this method returns a slice which
     *  is not part of the computation graph of the original tensor (meaning no autograd).
     *
     * @return A new {@link Tensor} instance which is a slice of the original tensor without autograd.
     */
    Nda detached();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy