Interface OpExecutioner

    • Method Detail

      • isVerbose

        boolean isVerbose()
        This method returns true if verbose mode is enabled, false otherwise
        Returns:
      • isDebug

        boolean isDebug()
        This method returns true if debug mode is enabled, false otherwise
        Returns:
      • getLastOp

        String getLastOp()
        This method returns opName of the last invoked op
        Returns:
      • exec

        INDArray exec​(Op op)
        Execute the operation
        Parameters:
        op - the operation to execute
      • exec

        INDArray exec​(Op op,
                      OpContext opContext)
        Execute the operation
        Parameters:
        op - the operation to execute
      • execAndReturn

        TransformOp execAndReturn​(TransformOp op)
        Execute a TransformOp and return the result
        Parameters:
        op - the operation to execute
      • execAndReturn

        ReduceOp execAndReturn​(ReduceOp op)
        Execute and return the result from an accumulation
        Parameters:
        op - the operation to execute
        Returns:
        the accumulated result
      • execAndReturn

        Variance execAndReturn​(Variance op)
        Execute and return the result from an accumulation
        Parameters:
        op - the operation to execute
        Returns:
        the accumulated result
      • execAndReturn

        IndexAccumulation execAndReturn​(IndexAccumulation op)
        Execute and return the result from an index accumulation
        Parameters:
        op - the index accumulation operation to execute
        Returns:
        the accumulated index
      • execAndReturn

        ScalarOp execAndReturn​(ScalarOp op)
        Execute and return the result from a scalar op
        Parameters:
        op - the operation to execute
        Returns:
        the accumulated result
      • execAndReturn

        BroadcastOp execAndReturn​(BroadcastOp op)
        Execute and return the result from a vector op
        Parameters:
        op -
      • exec

        INDArray exec​(ReduceOp reduceOp)
        Execute a reduceOp, possibly along one or more dimensions
        Parameters:
        reduceOp - the reduceOp
        Returns:
        the reduceOp op
      • exec

        INDArray exec​(BroadcastOp broadcast)
        Execute a broadcast op, possibly along one or more dimensions
        Parameters:
        broadcast - the accumulation
        Returns:
        the broadcast op
      • exec

        INDArray exec​(ScalarOp broadcast)
        Execute ScalarOp
        Parameters:
        broadcast -
        Returns:
      • exec

        INDArray exec​(Variance accumulation)
        Execute an variance accumulation op, possibly along one or more dimensions
        Parameters:
        accumulation - the accumulation
        Returns:
        the accmulation op
      • exec

        INDArray exec​(IndexAccumulation indexAccum)
        Execute an index accumulation along one or more dimensions
        Parameters:
        indexAccum - the index accumulation operation
        Returns:
        result
      • execAndReturn

        Op execAndReturn​(Op op)
        Execute and return a result ndarray from the given op
        Parameters:
        op - the operation to execute
        Returns:
        the result from the operation
      • exec

        void exec​(MetaOp op)
        Execute MetaOp
        Parameters:
        op -
      • exec

        void exec​(GridOp op)
        Execute GridOp
        Parameters:
        op -
      • exec

        void exec​(Aggregate op)
        Parameters:
        op -
      • exec

        <T extends Aggregate> void exec​(Batch<T> batch)
        This method executes previously built batch
        Parameters:
        batch -
      • exec

        void exec​(List<Aggregate> batch)
        This method takes arbitrary sized list of aggregates, and packs them into batches
        Parameters:
        batch -
      • exec

        INDArray exec​(RandomOp op)
        This method executes specified RandomOp using default RNG available via Nd4j.getRandom()
        Parameters:
        op -
      • exec

        INDArray exec​(RandomOp op,
                      Random rng)
        This method executes specific RandomOp against specified RNG
        Parameters:
        op -
        rng -
      • getEnvironmentInformation

        Properties getEnvironmentInformation()
        This method return set of key/value and key/key/value objects, describing current environment
        Returns:
      • setProfilingConfig

        void setProfilingConfig​(ProfilerConfig config)
        This method stores specified configuration.
        Parameters:
        config -
      • getTADManager

        TADManager getTADManager()
        This method returns TADManager instance used for this OpExecutioner
        Returns:
      • printEnvironmentInformation

        void printEnvironmentInformation()
        This method prints out environmental information returned by getEnvironmentInformation() method
      • push

        void push()
        This method ensures all operations that supposed to be executed at this moment, are executed.
      • commit

        void commit()
        This method ensures all operations that supposed to be executed at this moment, are executed and finished.
      • thresholdEncode

        INDArray thresholdEncode​(INDArray input,
                                 double threshold)
        This method encodes array as thresholds, updating input array at the same time
        Parameters:
        input -
        Returns:
        encoded array is returned
      • thresholdEncode

        INDArray thresholdEncode​(INDArray input,
                                 double threshold,
                                 Integer boundary)
        This method encodes array as thresholds, updating input array at the same time
        Parameters:
        input -
        Returns:
        encoded array is returned
      • thresholdDecode

        INDArray thresholdDecode​(INDArray encoded,
                                 INDArray target)
        This method decodes thresholds array, and puts it into target array
        Parameters:
        encoded -
        target -
        Returns:
        target is returned
      • bitmapEncode

        long bitmapEncode​(INDArray indArray,
                          INDArray target,
                          double threshold)
        This method returns number of elements affected by encoder
        Parameters:
        indArray -
        target -
        threshold -
        Returns:
      • bitmapEncode

        INDArray bitmapEncode​(INDArray indArray,
                              double threshold)
        Parameters:
        indArray -
        threshold -
        Returns:
      • getCustomOperations

        Map<String,​CustomOpDescriptor> getCustomOperations()
        This method returns names of all custom operations available in current backend, and their number of input/output arguments
        Returns:
      • execAndReturn

        CustomOp execAndReturn​(CustomOp op)
        This method executes given CustomOp PLEASE NOTE: You're responsible for input/output validation
        Parameters:
        op -
      • exec

        INDArray[] exec​(CustomOp op,
                        OpContext context)
        This method executes op with given context
        Parameters:
        op -
        context -
        Returns:
        method returns output arrays defined within context
      • allocateOutputArrays

        INDArray[] allocateOutputArrays​(CustomOp op)
        Equivalent to calli
      • enableDebugMode

        void enableDebugMode​(boolean reallyEnable)
      • enableVerboseMode

        void enableVerboseMode​(boolean reallyEnable)
      • isExperimentalMode

        boolean isExperimentalMode()
      • registerGraph

        void registerGraph​(long id,
                           org.bytedeco.javacpp.Pointer graph)
      • forgetGraph

        void forgetGraph​(long id)
      • setElementsThreshold

        void setElementsThreshold​(int threshold)
        This method allows to set desired number of elements per thread, for performance optimization purposes. I.e. if array contains 2048 elements, and threshold is set to 1024, 2 threads will be used for given op execution. Default value: 1024
        Parameters:
        threshold -
      • setTadThreshold

        void setTadThreshold​(int threshold)
        This method allows to set desired number of sub-arrays per thread, for performance optimization purposes. I.e. if matrix has shape of 64 x 128, and threshold is set to 8, each thread will be processing 8 sub-arrays (sure, if you have 8 core cpu). If your cpu has, say, 4, cores, only 4 threads will be spawned, and each will process 16 sub-arrays Default value: 8
        Parameters:
        threshold -
      • getString

        String getString​(DataBuffer buffer,
                         long index)
        This method extracts String from Utf8Buffer
        Parameters:
        buffer -
        index -
        Returns:
      • buildContext

        OpContext buildContext()
        This method returns OpContext which can be used (and reused) to execute custom ops
        Returns:
      • createShapeInfo

        DataBuffer createShapeInfo​(long[] shape,
                                   long[] stride,
                                   long elementWiseStride,
                                   char order,
                                   DataType dtype,
                                   boolean empty)
        This method returns shapeInfo DataBuffer
        Parameters:
        shape -
        stride -
        elementWiseStride -
        order -
        dtype -
        Returns:
      • createShapeInfo

        DataBuffer createShapeInfo​(long[] shape,
                                   long[] stride,
                                   long elementWiseStride,
                                   char order,
                                   DataType dtype,
                                   long extra)
      • tadShapeInfoAndOffsets

        TadPack tadShapeInfoAndOffsets​(INDArray array,
                                       int[] dimension)
        This method returns host/device tad buffers
      • createConstantBuffer

        DataBuffer createConstantBuffer​(long[] values,
                                        DataType desiredType)
        This method returns constant buffer for the given jvm array
        Parameters:
        values -
        Returns:
      • createConstantBuffer

        DataBuffer createConstantBuffer​(int[] values,
                                        DataType desiredType)
      • createConstantBuffer

        DataBuffer createConstantBuffer​(float[] values,
                                        DataType desiredType)
      • createConstantBuffer

        DataBuffer createConstantBuffer​(double[] values,
                                        DataType desiredType)
      • useCount

        int useCount​(DataBuffer buffer)
        This method returns reference use count from the Buffer
        Parameters:
        buffer -
        Returns: