public class CpuNDArrayFactory extends BaseNDArrayFactory
NDArrayFactory
for cpus and the nd4j-native backend.| Modifier and Type | Field and Description |
|---|---|
protected ThreadLocal<org.bytedeco.javacpp.PointerPointer> |
extrazA |
protected ThreadLocal<org.bytedeco.javacpp.PointerPointer> |
extrazB |
protected ThreadLocal<Integer> |
extrazSize |
blas, lapack, level1, level2, level3, orderC, FORTRAN| Constructor and Description |
|---|
CpuNDArrayFactory() |
CpuNDArrayFactory(org.nd4j.linalg.api.buffer.DataBuffer.Type dtype,
char order) |
CpuNDArrayFactory(org.nd4j.linalg.api.buffer.DataBuffer.Type dtype,
Character order) |
| Modifier and Type | Method and Description |
|---|---|
INDArray |
accumulate(INDArray target,
INDArray... arrays) |
INDArray |
average(Collection<INDArray> arrays) |
INDArray |
average(INDArray[] arrays) |
INDArray |
average(INDArray target,
Collection<INDArray> arrays)
This method averages input arrays, and returns averaged array
|
INDArray |
average(INDArray target,
INDArray[] arrays)
This method averages input arrays, and returns averaged array
|
INDArray |
concat(int dimension,
INDArray... toConcat)
concatenate ndarrays along a dimension
|
org.nd4j.linalg.api.buffer.DataBuffer |
convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc,
org.nd4j.linalg.api.buffer.DataBuffer source,
org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst) |
void |
convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc,
org.nd4j.linalg.api.buffer.DataBuffer source,
org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst,
org.nd4j.linalg.api.buffer.DataBuffer target) |
INDArray |
convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc,
INDArray source,
org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst)
This method converts Single/Double precision databuffer to Half-precision databuffer
|
void |
convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc,
org.bytedeco.javacpp.Pointer source,
org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst,
org.bytedeco.javacpp.Pointer target,
long length) |
INDArray |
create(org.nd4j.linalg.api.buffer.DataBuffer data) |
INDArray |
create(org.nd4j.linalg.api.buffer.DataBuffer data,
int[] shape) |
INDArray |
create(org.nd4j.linalg.api.buffer.DataBuffer data,
int[] shape,
int[] stride,
long offset) |
INDArray |
create(org.nd4j.linalg.api.buffer.DataBuffer data,
int[] newShape,
int[] newStride,
long offset,
char ordering) |
INDArray |
create(org.nd4j.linalg.api.buffer.DataBuffer buffer,
int[] shape,
long offset) |
INDArray |
create(org.nd4j.linalg.api.buffer.DataBuffer data,
int rows,
int columns,
int[] stride,
long offset) |
INDArray |
create(double[][] data)
Create an ndarray with the given data layout
|
INDArray |
create(double[][] data,
char ordering) |
INDArray |
create(double[] data,
int[] shape,
char ordering) |
INDArray |
create(double[] data,
int[] shape,
int[] stride,
long offset)
Creates an ndarray with the specified shape
|
INDArray |
create(double[] data,
int[] shape,
int[] stride,
long offset,
char ordering) |
INDArray |
create(double[] data,
int[] shape,
long offset) |
INDArray |
create(float[][] floats) |
INDArray |
create(float[][] data,
char ordering) |
INDArray |
create(float[] data,
int[] shape,
int[] stride,
long offset)
Creates an ndarray with the specified shape
|
INDArray |
create(float[] data,
int[] shape,
int[] stride,
long offset,
char ordering) |
INDArray |
create(float[] data,
int[] shape,
long offset) |
INDArray |
create(float[] data,
int[] shape,
long offset,
Character order) |
INDArray |
create(float[] data,
int rows,
int columns,
int[] stride,
long offset,
char ordering) |
INDArray |
create(int[] shape,
char ordering) |
INDArray |
create(int[] shape,
org.nd4j.linalg.api.buffer.DataBuffer buffer) |
INDArray |
create(List<INDArray> list,
int[] shape)
Creates an ndarray with the specified shape
|
INDArray |
create(List<INDArray> list,
int[] shape,
char ordering) |
void |
createBlas() |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer data) |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer data,
int[] shape) |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer data,
int[] shape,
int[] stride) |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer data,
int[] shape,
int[] stride,
long offset) |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer data,
int[] newDims,
int[] newStrides,
long offset,
char ordering) |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer buffer,
int[] shape,
long offset) |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer buffer,
int[] shape,
long offset,
char ordering) |
IComplexNDArray |
createComplex(org.nd4j.linalg.api.buffer.DataBuffer data,
int rows,
int columns,
int[] stride,
long offset) |
IComplexNDArray |
createComplex(double[] data,
int[] shape,
int[] stride,
long offset)
Creates a complex ndarray with the specified shape
|
IComplexNDArray |
createComplex(double[] data,
int[] shape,
int[] stride,
long offset,
char ordering)
Create a complex ndarray with the given data
|
IComplexNDArray |
createComplex(double[] data,
int[] shape,
long offset) |
IComplexNDArray |
createComplex(double[] data,
int[] shape,
long offset,
char ordering) |
IComplexNDArray |
createComplex(float[] dim) |
IComplexNDArray |
createComplex(float[] data,
Character order) |
IComplexNDArray |
createComplex(float[] data,
int[] shape,
int[] stride,
long offset)
Creates a complex ndarray with the specified shape
|
IComplexNDArray |
createComplex(float[] data,
int[] shape,
int[] stride,
long offset,
char ordering)
Create a complex ndarray with the given data
|
IComplexNDArray |
createComplex(float[] data,
int[] shape,
long offset) |
IComplexNDArray |
createComplex(float[] data,
int[] shape,
long offset,
char ordering) |
IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape)
Create a complex ndarray from the passed in indarray
|
IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape,
char ordering) |
IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape,
int[] stride,
char ordering) |
IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape,
int[] stride,
long offset) |
IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape,
int[] stride,
long offset,
char ordering) |
IComplexNDArray |
createComplex(IComplexNumber[] data,
int[] shape,
long offset,
char ordering) |
IComplexNDArray |
createComplex(INDArray arr)
Create a complex ndarray from the passed in indarray
|
IComplexNDArray |
createComplex(List<IComplexNDArray> arrs,
int[] shape)
Create a complex ndarray from the passed in indarray
|
IComplexDouble |
createDouble(double real,
double imag)
Create an instance of a complex double
|
IComplexFloat |
createFloat(float real,
float imag)
Create float
|
INDArray |
createFromNpyFile(File file)
Create from a given numpy file.
|
INDArray |
createFromNpyPointer(org.bytedeco.javacpp.Pointer pointer)
Create from an in memory numpy pointer
|
void |
createLapack() |
void |
createLevel1() |
void |
createLevel2() |
void |
createLevel3() |
INDArray |
createUninitialized(int[] shape,
char ordering) |
INDArray |
createUninitializedDetached(int[] shape,
char ordering) |
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
|
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
|
void |
shuffle(Collection<INDArray> array,
Random rnd,
int... dimension)
Symmetric in place shuffle of an ndarray
along a specified set of dimensions.
|
void |
shuffle(INDArray array,
Random rnd,
int... dimension)
In place shuffle of an ndarray
along a specified set of dimensions
|
void |
shuffle(List<INDArray> arrays,
Random rnd,
List<int[]> dimensions)
Symmetric in place shuffle of an ndarray
along a specified set of dimensions.
|
INDArray |
sort(INDArray x,
boolean descending) |
INDArray |
sort(INDArray x,
boolean descending,
int... dimension) |
INDArray |
specialConcat(int dimension,
INDArray... toConcat)
For CPU backend this method is equal to concat()
|
INDArray[] |
tear(INDArray tensor,
int... dimensions) |
INDArray |
toFlattened(char order,
Collection<INDArray> matrices) |
appendBias, arange, bilinearProducts, blas, complexFlatten, complexFlatten, complexOnes, complexOnes, complexOnes, complexScalar, complexScalar, complexValueOf, complexValueOf, complexValueOf, complexValueOf, complexZeros, complexZeros, complexZeros, concat, copy, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, createComplex, dtype, eye, hstack, lapack, level1, level2, level3, linspace, ones, ones, ones, order, rand, rand, rand, rand, rand, rand, rand, rand, rand, rand, rand, rand, rand, randn, randn, randn, randn, randn, randn, randn, randn, reverse, rot, rot90, scalar, scalar, scalar, scalar, scalar, scalar, scalar, scalar, scalar, scalar, scalar, scalar, scalar, setDType, setOrder, toFlattened, toFlattened, toFlattened, toFlattened, validateConcat, valueArrayOf, valueArrayOf, vstack, zeros, zeros, zerosprotected ThreadLocal<org.bytedeco.javacpp.PointerPointer> extrazA
protected ThreadLocal<org.bytedeco.javacpp.PointerPointer> extrazB
protected ThreadLocal<Integer> extrazSize
public CpuNDArrayFactory()
public CpuNDArrayFactory(org.nd4j.linalg.api.buffer.DataBuffer.Type dtype,
Character order)
public CpuNDArrayFactory(org.nd4j.linalg.api.buffer.DataBuffer.Type dtype,
char order)
public void createBlas()
public void createLevel1()
public void createLevel2()
public void createLevel3()
public void createLapack()
public INDArray create(int[] shape, org.nd4j.linalg.api.buffer.DataBuffer buffer)
public IComplexFloat createFloat(float real, float imag)
createFloat in interface NDArrayFactorycreateFloat in class BaseNDArrayFactoryreal - real componentimag - imag componentpublic IComplexDouble createDouble(double real, double imag)
createDouble in interface NDArrayFactorycreateDouble in class BaseNDArrayFactoryreal - the real componentimag - the imaginary componentpublic INDArray create(double[][] data)
data - the data to create the ndarray withpublic INDArray create(double[][] data, char ordering)
public IComplexNDArray createComplex(INDArray arr)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactoryarr - the arr to wrappublic IComplexNDArray createComplex(IComplexNumber[] data, int[] shape)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactorydata - the data to wrapshape - public IComplexNDArray createComplex(List<IComplexNDArray> arrs, int[] shape)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactoryarrs - the arr to wrapshape - public INDArray create(org.nd4j.linalg.api.buffer.DataBuffer data)
public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer data)
public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer data, int rows, int columns, int[] stride, long offset)
public INDArray create(org.nd4j.linalg.api.buffer.DataBuffer data, int rows, int columns, int[] stride, long offset)
public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer data, int[] shape, int[] stride, long offset)
public IComplexNDArray createComplex(IComplexNumber[] data, int[] shape, int[] stride, long offset)
public IComplexNDArray createComplex(IComplexNumber[] data, int[] shape, int[] stride, long offset, char ordering)
public IComplexNDArray createComplex(IComplexNumber[] data, int[] shape, int[] stride, char ordering)
public IComplexNDArray createComplex(IComplexNumber[] data, int[] shape, long offset, char ordering)
public IComplexNDArray createComplex(IComplexNumber[] data, int[] shape, char ordering)
public IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, long offset)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactorydata - the data to use with the ndarrayshape - the shape of the ndarraystride - the stride for the ndarrayoffset - the offset of the ndarraypublic INDArray create(int[] shape, char ordering)
public INDArray createUninitialized(int[] shape, char ordering)
public INDArray createUninitializedDetached(int[] shape, char ordering)
public INDArray create(org.nd4j.linalg.api.buffer.DataBuffer data, int[] newShape, int[] newStride, long offset, char ordering)
public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer data, int[] newDims, int[] newStrides, long offset, char ordering)
public IComplexNDArray createComplex(float[] data, Character order)
public INDArray create(float[] data, int rows, int columns, int[] stride, long offset, char ordering)
public INDArray create(double[] data, int[] shape, char ordering)
public INDArray create(double[] data, int[] shape, long offset)
public INDArray create(double[] data, int[] shape, int[] stride, long offset, char ordering)
public INDArray create(float[] data, int[] shape, int[] stride, long offset)
create in interface NDArrayFactorycreate in class BaseNDArrayFactorydata - shape - the shape of the ndarraystride - the stride for the ndarrayoffset - the offset of the ndarraypublic IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, long offset)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactorydata - shape - the shape of the ndarraystride - the stride for the ndarrayoffset - the offset of the ndarraypublic INDArray create(double[] data, int[] shape, int[] stride, long offset)
create in interface NDArrayFactorycreate in class BaseNDArrayFactorydata - shape - the shape of the ndarraystride - the stride for the ndarrayoffset - the offset of the ndarraypublic INDArray create(org.nd4j.linalg.api.buffer.DataBuffer data, int[] shape)
public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer data, int[] shape)
public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer data, int[] shape, int[] stride)
public INDArray create(org.nd4j.linalg.api.buffer.DataBuffer data, int[] shape, int[] stride, long offset)
public INDArray create(List<INDArray> list, int[] shape)
create in interface NDArrayFactorycreate in class BaseNDArrayFactorylist - shape - the shape of the ndarraypublic IComplexNDArray createComplex(double[] data, int[] shape, int[] stride, long offset, char ordering)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactorydata - the data to use with tne ndarrayshape - the shape of the ndarraystride - the stride for the ndarrayoffset - the offset of the ndarrayordering - the ordering for the ndarraypublic IComplexNDArray createComplex(double[] data, int[] shape, long offset, char ordering)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactorydata - shape - offset - ordering - public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer buffer, int[] shape, long offset, char ordering)
public IComplexNDArray createComplex(double[] data, int[] shape, long offset)
createComplex in interface NDArrayFactorycreateComplex in class BaseNDArrayFactorydata - shape - offset - public IComplexNDArray createComplex(org.nd4j.linalg.api.buffer.DataBuffer buffer, int[] shape, long offset)
public IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, long offset, char ordering)
data - the data to use with tne ndarrayshape - the shape of the ndarraystride - the stride for the ndarrayoffset - the offset of the ndarrayordering - the ordering for the ndarraypublic INDArray create(float[][] floats)
public INDArray create(float[][] data, char ordering)
public IComplexNDArray createComplex(float[] dim)
public INDArray create(float[] data, int[] shape, int[] stride, long offset, char ordering)
public INDArray create(org.nd4j.linalg.api.buffer.DataBuffer buffer, int[] shape, long offset)
public IComplexNDArray createComplex(float[] data, int[] shape, long offset, char ordering)
data - shape - offset - ordering - public IComplexNDArray createComplex(float[] data, int[] shape, long offset)
data - shape - offset - public INDArray create(float[] data, int[] shape, long offset)
create in interface NDArrayFactorycreate in class BaseNDArrayFactorypublic INDArray toFlattened(char order, Collection<INDArray> matrices)
public INDArray concat(int dimension, INDArray... toConcat)
concat in interface NDArrayFactoryconcat in class BaseNDArrayFactorydimension - the dimension to concatenate alongtoConcat - the ndarrays to concatenatepublic INDArray specialConcat(int dimension, INDArray... toConcat)
dimension - the dimension to concatneate alongtoConcat - the ndarrays to concateneatepublic INDArray pullRows(INDArray source, int sourceDimension, int[] indexes)
pullRows in interface NDArrayFactorypullRows in class BaseNDArrayFactorysource - source tensorsourceDimension - dimension of source tensorindexes - indexes from source arraypublic INDArray pullRows(INDArray source, int sourceDimension, int[] indexes, char order)
pullRows in interface NDArrayFactorypullRows in class BaseNDArrayFactorysource - source tensorsourceDimension - dimension of source tensorindexes - indexes from source arraypublic INDArray average(INDArray target, INDArray[] arrays)
target - arrays - public INDArray average(INDArray target, Collection<INDArray> arrays)
target - arrays - public INDArray average(Collection<INDArray> arrays)
public void shuffle(INDArray array, Random rnd, int... dimension)
array - the ndarray to shuffledimension - the dimension to do the shufflepublic void shuffle(Collection<INDArray> array, Random rnd, int... dimension)
array - the ndarray to shuffledimension - the dimension to do the shufflepublic void shuffle(List<INDArray> arrays, Random rnd, List<int[]> dimensions)
arrays - the ndarrays to shuffledimensions - the dimensions to do the shufflepublic INDArray convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc, INDArray source, org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst)
typeSrc - source - typeDst - @returnpublic org.nd4j.linalg.api.buffer.DataBuffer convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc,
org.nd4j.linalg.api.buffer.DataBuffer source,
org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst)
public void convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc,
org.bytedeco.javacpp.Pointer source,
org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst,
org.bytedeco.javacpp.Pointer target,
long length)
public void convertDataEx(org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeSrc,
org.nd4j.linalg.api.buffer.DataBuffer source,
org.nd4j.linalg.api.buffer.DataBuffer.TypeEx typeDst,
org.nd4j.linalg.api.buffer.DataBuffer target)
public INDArray createFromNpyPointer(org.bytedeco.javacpp.Pointer pointer)
pointer - the pointer to the
numpy arraypublic INDArray createFromNpyFile(File file)
file - the file to create the ndarray fromCopyright © 2017. All rights reserved.