Interface NDArrayFactory

    • Method Detail

      • blas

        Blas blas()
        Return extra blas operations
        Returns:
      • level1

        Level1 level1()
        Return the level 1 blas operations
        Returns:
      • level2

        Level2 level2()
        Return the level 2 blas operations
        Returns:
      • level3

        Level3 level3()
        Return the level 3 blas operations
        Returns:
      • createBlas

        void createBlas()
        Create blas
      • createLevel1

        void createLevel1()
        Create level 1
      • createLevel2

        void createLevel2()
        Create level 2
      • createLevel3

        void createLevel3()
        Create level 3
      • createLapack

        void createLapack()
        Create lapack
      • setOrder

        void setOrder​(char order)
        Sets the order. Primarily for testing purposes
        Parameters:
        order -
      • setDType

        void setDType​(DataType dtype)
        Sets the data opType
        Parameters:
        dtype -
      • create

        INDArray create​(int[] shape,
                        DataBuffer buffer)
        Create an ndarray with the given shape and data
        Parameters:
        shape - the shape to use
        buffer - the buffer to use
        Returns:
        the ndarray
      • order

        char order()
        Returns the order for this ndarray for internal data storage
        Returns:
        the order (c or f)
      • dtype

        DataType dtype()
        Returns the data opType for this ndarray
        Returns:
        the data opType for this ndarray
      • toFlattened

        INDArray toFlattened​(Collection<INDArray> matrices)
        /** Returns a flattened ndarray with all of the elements in each ndarray regardless of dimension
        Parameters:
        matrices - the ndarrays to use
        Returns:
        a flattened ndarray of the elements in the order of titerating over the ndarray and the linear view of each
      • toFlattened

        INDArray toFlattened​(int length,
                             Iterator<? extends INDArray>... matrices)
        Returns a flattened ndarray with all of the elements in each ndarray regardless of dimension
        Parameters:
        matrices - the ndarrays to use
        Returns:
        a flattened ndarray of the elements in the order of titerating over the ndarray and the linear view of each
      • toFlattened

        INDArray toFlattened​(char order,
                             Collection<INDArray> matrices)
        Returns a flattened ndarray with all elements in each ndarray regardless of dimension. Order is specified to ensure flattening order is consistent across
        Parameters:
        matrices - the ndarrays to flatten
        order - the order in which the ndarray values should be flattened
        Returns:
      • bilinearProducts

        INDArray bilinearProducts​(INDArray curr,
                                  INDArray in)
        Returns a column vector where each entry is the nth bilinear product of the nth slices of the two tensors.
      • toFlattened

        INDArray toFlattened​(INDArray... matrices)
        Flatten all of the ndarrays in to one long vector
        Parameters:
        matrices - the matrices to flatten
        Returns:
        the flattened vector
      • toFlattened

        INDArray toFlattened​(char order,
                             INDArray... matrices)
        Flatten all of the ndarrays in to one long vector
        Parameters:
        matrices - the matrices to flatten
        Returns:
        the flattened vector
      • eye

        INDArray eye​(long n)
        Create the identity ndarray
        Parameters:
        n - the number for the identity
        Returns:
      • rot90

        void rot90​(INDArray toRotate)
        Rotate a matrix 90 degrees
        Parameters:
        toRotate - the matrix to rotate
      • rot

        INDArray rot​(INDArray reverse)
        Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc
        Parameters:
        reverse - the matrix to reverse
        Returns:
        the reversed matrix
      • reverse

        INDArray reverse​(INDArray reverse)
        Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc
        Parameters:
        reverse - the matrix to reverse
        Returns:
        the reversed matrix
      • arange

        INDArray arange​(double begin,
                        double end,
                        double step)
        Array of evenly spaced values. Returns a row vector
        Parameters:
        begin - the begin of the range
        end - the end of the range
        Returns:
        the range vector
      • copy

        void copy​(INDArray a,
                  INDArray b)
        Copy a to b
        Parameters:
        a - the origin matrix
        b - the destination matrix
      • rand

        INDArray rand​(int[] shape,
                      float min,
                      float max,
                      Random rng)
        Generates a random matrix between min and max
        Parameters:
        shape - the number of rows of the matrix
        min - the minimum number
        max - the maximum number
        rng - the rng to use
        Returns:
        a drandom matrix of the specified shape and range
      • rand

        INDArray rand​(long[] shape,
                      float min,
                      float max,
                      Random rng)
      • rand

        INDArray rand​(long rows,
                      long columns,
                      float min,
                      float max,
                      Random rng)
        Generates a random matrix between min and max
        Parameters:
        rows - the number of rows of the matrix
        columns - the number of columns in the matrix
        min - the minimum number
        max - the maximum number
        rng - the rng to use
        Returns:
        a drandom matrix of the specified shape and range
      • create

        INDArray create​(double[][] data)
        Create an ndarray with the given data layout
        Parameters:
        data - the data to create the ndarray with
        Returns:
        the ndarray with the given data layout
      • create

        INDArray create​(double[][] data,
                        char ordering)
        Create a matrix from the given data and ordering
        Parameters:
        data -
        ordering -
        Returns:
      • concat

        INDArray concat​(int dimension,
                        INDArray... toConcat)
        Concatneate ndarrays along a dimension
        Parameters:
        dimension - the dimension to concatneate along
        toConcat - the ndarrays to concateneate
        Returns:
        the concatneated ndarrays
      • specialConcat

        INDArray specialConcat​(int dimension,
                               INDArray... toConcat)
        Concatenate ndarrays along a dimension PLEASE NOTE: This method is special for GPU backend, it works on HOST side only.
        Parameters:
        dimension - the dimension to concatneate along
        toConcat - the ndarrays to concateneate
        Returns:
        the concatneated ndarrays
      • pullRows

        INDArray pullRows​(INDArray source,
                          int sourceDimension,
                          int[] indexes)
        This method produces concatenated array, that consist from tensors, fetched from source array, against some dimension and specified indexes
        Parameters:
        source - source tensor
        sourceDimension - dimension of source tensor
        indexes - indexes from source array
        Returns:
      • pullRows

        INDArray pullRows​(INDArray source,
                          int sourceDimension,
                          long[] indexes)
      • pullRows

        INDArray pullRows​(INDArray source,
                          int sourceDimension,
                          int[] indexes,
                          char order)
        This method produces concatenated array, that consist from tensors, fetched from source array, against some dimension and specified indexes
        Parameters:
        source - source tensor
        sourceDimension - dimension of source tensor
        indexes - indexes from source array
        order - order for result array
        Returns:
      • pullRows

        INDArray pullRows​(INDArray source,
                          INDArray destination,
                          int sourceDimension,
                          int[] indexes)
        * This method produces concatenated array, that consist from tensors, fetched from source array, against some dimension and specified indexes in to the destination array
        Parameters:
        source -
        destination -
        sourceDimension -
        indexes -
        Returns:
      • shuffle

        void shuffle​(INDArray array,
                     Random rnd,
                     int... dimension)
        In place shuffle of an ndarray along a specified set of dimensions
        Parameters:
        array - the ndarray to shuffle
        dimension - the dimension to do the shuffle
      • shuffle

        void shuffle​(Collection<INDArray> array,
                     Random rnd,
                     int... dimension)
        Symmetric in place shuffle of an ndarray along a specified set of dimensions. All arrays should have equal shapes.
        Parameters:
        array - the ndarray to shuffle
        dimension - the dimension to do the shuffle
      • shuffle

        void shuffle​(List<INDArray> array,
                     Random rnd,
                     List<int[]> dimensions)
        Symmetric in place shuffle of an ndarray along a specified set of dimensions. Each array in list should have it's own dimension at the same index of dimensions array
        Parameters:
        array - the ndarray to shuffle
        dimensions - the dimensions to do the shuffle
      • average

        INDArray average​(INDArray target,
                         INDArray[] arrays)
        This method averages input arrays, and returns averaged array
        Parameters:
        arrays -
        Returns:
      • average

        INDArray average​(INDArray[] arrays)
        This method averages input arrays, and returns averaged array
        Parameters:
        arrays -
        Returns:
      • average

        INDArray average​(Collection<INDArray> arrays)
        This method averages input arrays, and returns averaged array
        Parameters:
        arrays -
        Returns:
      • accumulate

        INDArray accumulate​(INDArray target,
                            INDArray... arrays)
        This method sums given arrays to target
        Parameters:
        target -
        arrays -
        Returns:
      • average

        INDArray average​(INDArray target,
                         Collection<INDArray> arrays)
        This method averages input arrays, and returns averaged array
        Parameters:
        arrays -
        Returns:
      • rand

        INDArray rand​(long rows,
                      long columns,
                      Random r)
        Create a random ndarray with the given shape using the given rng
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        r - the random generator to use
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(long rows,
                      long columns,
                      long seed)
        Create a random ndarray with the given shape using the given rng
        Parameters:
        rows - the number of rows in the matrix
        columns - the columns of the ndarray
        seed - the seed to use
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(long rows,
                      long columns)
        Create a random ndarray with the given shape using the current time as the seed
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(char order,
                      long rows,
                      long columns)
        Create a random (uniform 0-1) NDArray with the specified shape and order
        Parameters:
        order - Order ('c' or 'f') of the output array
        rows - Number of rows of the output array
        columns - Number of columns of the output array
      • randn

        INDArray randn​(long rows,
                       long columns,
                       Random r)
        Random normal using the given rng
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        r - the random generator to use
        Returns:
      • randn

        INDArray randn​(long rows,
                       long columns)
        Random normal (N(0,1)) using the current time stamp as the seed
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        Returns:
      • randn

        INDArray randn​(char order,
                       long rows,
                       long columns)
        Random normal N(0,1), with specified output order
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
      • randn

        INDArray randn​(long rows,
                       long columns,
                       long seed)
        Random normal using the specified seed
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        Returns:
      • rand

        INDArray rand​(int[] shape,
                      Distribution r)
        Create a random ndarray with the given shape using the given rng
        Parameters:
        shape - the shape of the ndarray
        r - the random generator to use
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(int[] shape,
                      Random r)
        Create a random ndarray with the given shape using the given rng
        Parameters:
        shape - the shape of the ndarray
        r - the random generator to use
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(int[] shape,
                      long seed)
        Create a random ndarray with the given shape using the given rng
        Parameters:
        shape - the shape of the ndarray
        seed - the seed to use
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(long[] shape,
                      long seed)
      • rand

        INDArray rand​(int[] shape)
        Create a random ndarray with the given shape using the current time as the seed
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(long[] shape)
        Create a random ndarray with the given shape using the current time as the seed
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(char order,
                      int[] shape)
        Create a random ndarray with the given shape, and specified output order
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the random ndarray with the specified shape
      • rand

        INDArray rand​(char order,
                      long[] shape)
        Create a random ndarray with the given shape and specified output order
        Parameters:
        order - the order of the array
        shape - the shape of the array
        Returns:
        the created ndarray
      • randn

        INDArray randn​(int[] shape,
                       Random r)
        Random normal using the given rng
        Parameters:
        shape - the shape of the ndarray
        r - the random generator to use
      • randn

        INDArray randn​(int[] shape)
        Random normal N(0,1) using the current time stamp as the seed
        Parameters:
        shape - the shape of the ndarray
      • randn

        INDArray randn​(long[] shape)
        Random normal N(0,1) using the current time stamp as the seed
        Parameters:
        shape - the shape of the ndarray
      • randn

        INDArray randn​(char order,
                       int[] shape)
        Random normal N(0,1) with the specified shape and order
        Parameters:
        order - the order ('c' or 'f') of the output array
        shape - the shape of the ndarray
      • randn

        INDArray randn​(char order,
                       long[] shape)
        Random normal N(0,1) with the specified shape and order
        Parameters:
        order - the order ('c' or 'f') of the output array
        shape - the shape of the ndarray
      • randn

        INDArray randn​(int[] shape,
                       long seed)
        Random normal using the specified seed
        Parameters:
        shape - the shape of the ndarray
        Returns:
      • randn

        INDArray randn​(long[] shape,
                       long seed)
        Random normal using the specified seed
        Parameters:
        shape - the shape of the ndarray
        Returns:
      • create

        INDArray create​(double[] data)
        Creates a row vector with the data
        Parameters:
        data - the columns of the ndarray
        Returns:
        the created ndarray
      • create

        INDArray create​(float[] data)
        Creates a row vector with the data
        Parameters:
        data - the columns of the ndarray
        Returns:
        the created ndarray
      • create

        INDArray create​(DataBuffer data)
        Creates a row vector with the data
        Parameters:
        data - the columns of the ndarray
        Returns:
        the created ndarray
      • create

        INDArray create​(long columns)
        Creates a row vector with the specified number of columns
        Parameters:
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • zeros

        INDArray zeros​(long rows,
                       long columns)
        Creates a row vector with the specified number of columns
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • zeros

        INDArray zeros​(long columns)
        Creates a row vector with the specified number of columns
        Parameters:
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • valueArrayOf

        INDArray valueArrayOf​(int[] shape,
                              double value)
        Creates an ndarray with the specified value as the only value in the ndarray
        Parameters:
        shape - the shape of the ndarray
        value - the value to assign
        Returns:
        the created ndarray
      • valueArrayOf

        INDArray valueArrayOf​(long[] shape,
                              double value)
      • valueArrayOf

        INDArray valueArrayOf​(long rows,
                              long columns,
                              double value)
        Creates a row vector with the specified number of columns
        Parameters:
        rows - the number of rows in the matrix
        columns - the columns of the ndarray
        value - the value to assign
        Returns:
        the created ndarray
      • ones

        INDArray ones​(long rows,
                      long columns)
        Creates a row vector with the specified number of columns
        Parameters:
        rows - the number of rows in the matrix
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • ones

        INDArray ones​(long columns)
        Creates a row vector with the specified number of columns
        Parameters:
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • hstack

        INDArray hstack​(INDArray... arrs)
        Concatenates two matrices horizontally. Matrices must have identical numbers of rows.
        Parameters:
        arrs -
      • vstack

        INDArray vstack​(INDArray... arrs)
        Concatenates two matrices vertically. Matrices must have identical numbers of columns.
        Parameters:
        arrs -
      • zeros

        INDArray zeros​(int[] shape)
        Create an ndarray of zeros
        Parameters:
        shape - the shape of the ndarray
        Returns:
        an ndarray with ones filled in
      • zeros

        INDArray zeros​(long[] shape)
      • ones

        INDArray ones​(int[] shape)
        Create an ndarray of ones
        Parameters:
        shape - the shape of the ndarray
        Returns:
        an ndarray with ones filled in
      • create

        INDArray create​(DataBuffer data,
                        long rows,
                        long columns,
                        int[] stride,
                        long offset)
        Creates an ndarray with the specified shape
        Parameters:
        data - the data to use with the ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(float[] data,
                        long rows,
                        long columns,
                        int[] stride,
                        long offset)
        Parameters:
        data -
        rows -
        columns -
        stride -
        offset -
        Returns:
      • create

        INDArray create​(float[] data,
                        int[] shape,
                        int[] stride,
                        long offset)
        Creates an ndarray with the specified shape
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(float[] data,
                        long[] shape,
                        long[] stride,
                        long offset)
      • create

        INDArray create​(float[] data,
                        long[] shape,
                        long[] stride,
                        char order,
                        DataType dataType)
      • create

        INDArray create​(double[] data,
                        int[] shape)
        Create an ndrray with the specified shape
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        Returns:
        the created ndarray
      • create

        INDArray create​(double[] data,
                        long[] shape)
      • create

        INDArray create​(float[] data,
                        long[] shape)
      • create

        INDArray create​(float[] data,
                        int[] shape)
        Create an ndrray with the specified shape
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        Returns:
        the created ndarray
      • create

        INDArray create​(double[] data,
                        long rows,
                        long columns,
                        int[] stride,
                        long offset)
        Creates an ndarray with the specified shape
        Parameters:
        data - the data to use with tne ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(double[] data,
                        int[] shape,
                        int[] stride,
                        long offset)
        Creates an ndarray with the specified shape
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(double[] data,
                        long[] shape,
                        long[] stride,
                        long offset)
      • create

        INDArray create​(DataBuffer data,
                        int[] shape)
        Create an ndrray with the specified shape
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        Returns:
        the created ndarray
      • create

        INDArray create​(DataBuffer data,
                        int[] shape,
                        int[] stride,
                        long offset)
        Creates an ndarray with the specified shape
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(DataBuffer data,
                        long[] shape,
                        long[] stride,
                        long offset)
      • create

        INDArray create​(List<INDArray> list,
                        int[] shape)
        Creates an ndarray with the specified shape
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(long rows,
                        long columns,
                        int[] stride,
                        long offset)
        Creates an ndarray with the specified shape
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(long rows,
                        long columns,
                        long[] stride,
                        long offset)
      • create

        INDArray create​(int[] shape,
                        int[] stride,
                        long offset)
        Creates an ndarray with the specified shape
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(long[] shape,
                        long[] stride,
                        long offset)
      • create

        INDArray create​(long rows,
                        long columns,
                        int[] stride)
        Creates an ndarray with the specified shape
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        Returns:
        the instance
      • create

        INDArray create​(int[] shape,
                        int[] stride)
        Creates an ndarray with the specified shape
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        Returns:
        the instance
      • create

        INDArray create​(long[] shape,
                        long[] stride)
      • create

        INDArray create​(long[] shape)
      • create

        INDArray create​(long rows,
                        long columns)
        Creates an ndarray with the specified shape
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        Returns:
        the instance
      • create

        INDArray create​(int[] shape)
        Creates an ndarray with the specified shape
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the instance
      • scalar

        INDArray scalar​(float value,
                        long offset)
        Create a scalar nd array with the specified value and offset
        Parameters:
        value - the value of the scalar
        offset - the offset of the ndarray
        Returns:
        the scalar nd array
      • scalar

        INDArray scalar​(double value,
                        long offset)
        Create a scalar nd array with the specified value and offset
        Parameters:
        value - the value of the scalar
        offset - the offset of the ndarray
        Returns:
        the scalar nd array
      • scalar

        INDArray scalar​(int value,
                        long offset)
      • scalar

        INDArray scalar​(Number value)
        Create a scalar ndarray with the specified offset
        Parameters:
        value - the value to initialize the scalar with
        Returns:
        the created ndarray
      • scalar

        INDArray scalar​(float value)
        Create a scalar nd array with the specified value and offset
        Parameters:
        value - the value of the scalar = * @return the scalar nd array
      • scalar

        INDArray scalar​(double value)
        Create a scalar nd array with the specified value and offset
        Parameters:
        value - the value of the scalar = * @return the scalar nd array
      • scalar

        INDArray scalar​(DataType dataType)
        Create a scalar nd array with the data type and a default value depending on the data type. Generally this will be an empty string for UTF8 or 0.0 for numerical values, or true for booleans.
        Parameters:
        dataType - the dataType of the scalar * @return the scalar nd array
      • create

        INDArray create​(float[] data,
                        int[] shape,
                        long offset)
        Parameters:
        data -
        shape -
        offset -
        Returns:
      • create

        INDArray create​(float[] data,
                        int[] shape,
                        char ordering)
        Parameters:
        data -
        shape -
        ordering -
        Returns:
      • create

        INDArray create​(float[][] floats)
        Parameters:
        floats -
        Returns:
      • create

        INDArray create​(float[][] data,
                        char ordering)
      • create

        INDArray create​(float[] data,
                        int[] shape,
                        int[] stride,
                        long offset,
                        char ordering)
        Parameters:
        data -
        shape -
        stride -
        offset -
        ordering -
        Returns:
      • create

        INDArray create​(DataBuffer buffer,
                        int[] shape,
                        long offset)
        Parameters:
        buffer -
        shape -
        offset -
        Returns:
      • create

        INDArray create​(int[] shape,
                        char ordering)
        Parameters:
        shape -
        ordering -
        Returns:
      • create

        INDArray create​(long[] shape,
                        char ordering)
      • create

        INDArray create​(DataType dataType,
                        long[] shape,
                        long[] paddings,
                        long[] paddingOffsets,
                        char ordering,
                        MemoryWorkspace workspace)
        Create an ndArray with padded Buffer
        Parameters:
        dataType -
        shape -
        paddings -
        paddingOffsets -
        ordering - Fortran 'f' or C/C++ 'c' ordering.
        workspace -
        Returns:
      • createUninitialized

        INDArray createUninitialized​(int[] shape,
                                     char ordering)
      • createUninitialized

        INDArray createUninitialized​(long[] shape,
                                     char ordering)
      • createUninitializedDetached

        INDArray createUninitializedDetached​(DataType dataType,
                                             char ordering,
                                             long... shape)
        Create an uninitialized ndArray. Detached from workspace.
        Parameters:
        dataType - data type. Exceptions will be thrown for UTF8, COMPRESSED and UNKNOWN data types.
        ordering - Fortran 'f' or C/C++ 'c' ordering.
        shape - the shape of the array.
        Returns:
        the created detached array.
      • create

        INDArray create​(DataBuffer data,
                        int[] newShape,
                        int[] newStride,
                        long offset,
                        char ordering)
        Parameters:
        data -
        newShape -
        newStride -
        offset -
        ordering -
        Returns:
      • create

        INDArray create​(DataBuffer data,
                        long[] newShape,
                        long[] newStride,
                        long offset,
                        char ordering)
      • create

        INDArray create​(DataBuffer data,
                        long[] newShape,
                        long[] newStride,
                        long offset,
                        long ews,
                        char ordering)
      • create

        INDArray create​(DataBuffer data,
                        long[] newShape,
                        long[] newStride,
                        long offset,
                        char ordering,
                        DataType dataType)
      • rand

        INDArray rand​(long rows,
                      long columns,
                      double min,
                      double max,
                      Random rng)
        Parameters:
        rows -
        columns -
        min -
        max -
        rng -
        Returns:
      • create

        INDArray create​(float[] data,
                        int[] shape,
                        long offset,
                        Character order)
        Parameters:
        data -
        shape -
        offset -
        order -
        Returns:
      • create

        INDArray create​(float[] data,
                        long rows,
                        long columns,
                        int[] stride,
                        long offset,
                        char ordering)
        Parameters:
        data -
        rows -
        columns -
        stride -
        offset -
        ordering -
        Returns:
      • create

        INDArray create​(double[] data,
                        int[] shape,
                        char ordering)
        Parameters:
        data -
        shape -
        ordering -
        Returns:
      • create

        INDArray create​(List<INDArray> list,
                        int[] shape,
                        char ordering)
        Parameters:
        list -
        shape -
        ordering -
        Returns:
      • create

        INDArray create​(double[] data,
                        int[] shape,
                        long offset)
        Parameters:
        data -
        shape -
        offset -
        Returns:
      • create

        INDArray create​(double[] data,
                        int[] shape,
                        int[] stride,
                        long offset,
                        char ordering)
        Parameters:
        data -
        shape -
        stride -
        offset -
        ordering -
        Returns:
      • rand

        INDArray rand​(int[] shape,
                      double min,
                      double max,
                      Random rng)
        Parameters:
        shape -
        min -
        max -
        rng -
        Returns:
      • rand

        INDArray rand​(long[] shape,
                      double min,
                      double max,
                      Random rng)
      • create

        INDArray create​(int[] ints,
                        int[] ints1,
                        int[] stride,
                        long offset)
        Parameters:
        ints -
        ints1 -
        stride -
        offset -
        Returns:
      • create

        INDArray create​(int[] shape,
                        int[] ints1,
                        int[] stride,
                        char order,
                        long offset)
        Parameters:
        shape -
        ints1 -
        stride -
        order -
        offset -
        Returns:
      • create

        INDArray create​(long rows,
                        long columns,
                        char ordering)
        Parameters:
        rows -
        columns -
        ordering -
        Returns:
      • create

        INDArray create​(float[] data,
                        char order)
        Parameters:
        data -
        order -
        Returns:
      • create

        INDArray create​(float[] data,
                        int[] shape,
                        int[] stride,
                        char order,
                        long offset)
        Parameters:
        data -
        shape -
        stride -
        order -
        offset -
        Returns:
      • create

        INDArray create​(float[] data,
                        long[] shape,
                        long[] stride,
                        char order,
                        long offset)
      • create

        INDArray create​(DataBuffer buffer,
                        int[] shape,
                        int[] stride,
                        char order,
                        long offset)
        Parameters:
        buffer -
        shape -
        stride -
        order -
        offset -
        Returns:
      • create

        INDArray create​(double[] data,
                        char order)
        Parameters:
        data -
        order -
        Returns:
      • create

        INDArray create​(double[] data,
                        int[] shape,
                        int[] stride,
                        char order,
                        long offset)
        Parameters:
        data -
        shape -
        stride -
        order -
        offset -
        Returns:
      • create

        INDArray create​(int[] shape,
                        int[] stride,
                        long offset,
                        char ordering)
        Parameters:
        shape -
        stride -
        offset -
        ordering -
        Returns:
      • create

        INDArray create​(long[] shape,
                        long[] stride,
                        long offset,
                        char ordering)
      • convertDataEx

        void convertDataEx​(DataTypeEx typeSrc,
                           org.bytedeco.javacpp.Pointer source,
                           DataTypeEx typeDst,
                           org.bytedeco.javacpp.Pointer target,
                           long length)
        Parameters:
        typeSrc -
        source -
        typeDst -
        target -
        length -
      • convertDataEx

        void convertDataEx​(DataTypeEx typeSrc,
                           org.bytedeco.javacpp.Pointer source,
                           DataTypeEx typeDst,
                           DataBuffer buffer)
        Parameters:
        typeSrc -
        source -
        typeDst -
        buffer -
      • createFromNpyPointer

        INDArray createFromNpyPointer​(org.bytedeco.javacpp.Pointer pointer)
        Create from an in memory numpy pointer
        Parameters:
        pointer - the pointer to the numpy array
        Returns:
        an ndarray created from the in memory numpy pointer
      • createFromNpyHeaderPointer

        INDArray createFromNpyHeaderPointer​(org.bytedeco.javacpp.Pointer pointer)
        Create from an in memory numpy header. Use this when not interopping directly from python.
        Parameters:
        pointer - the pointer to the numpy header
        Returns:
        an ndarray created from the in memory numpy pointer
      • createFromNpyFile

        INDArray createFromNpyFile​(File file)
        Create from a given numpy file.
        Parameters:
        file - the file to create the ndarray from
        Returns:
        the created ndarray
      • createFromNpzFile

        Map<String,​INDArray> createFromNpzFile​(File file)
                                              throws Exception
        Create a Map from given npz file.
        Parameters:
        file - the file to create the map from
        Returns:
        Map
        Throws:
        Exception
      • convertToNumpy

        org.bytedeco.javacpp.Pointer convertToNumpy​(INDArray array)
        Convert an INDArray to a numpy array. This will usually be used for writing out to an external source. Note that this will create a zero copy reference to this ndarray's underlying data.
        Parameters:
        array - the array to convert
      • create

        INDArray create​(float[] data,
                        long[] shape,
                        long[] stride,
                        long offset,
                        char ordering)
      • create

        INDArray create​(double[] data,
                        long[] shape,
                        long[] stride,
                        long offset,
                        char ordering)
      • tear

        INDArray[] tear​(INDArray tensor,
                        int... dimensions)
        Parameters:
        tensor -
        dimensions -
        Returns:
      • sort

        INDArray sort​(INDArray x,
                      boolean descending)
        Parameters:
        x -
        descending -
        Returns:
      • create

        INDArray create​(float[] data,
                        long[] shape,
                        long offset,
                        Character order)
      • create

        INDArray create​(double[] data,
                        long[] shape,
                        long offset,
                        Character order)
      • create

        INDArray create​(float[] data,
                        long[] shape,
                        char ordering)
      • create

        INDArray create​(double[] data,
                        long[] shape,
                        char ordering)