Java Code Examples for org.nd4j.linalg.util.ArrayUtil#toFloats()

The following examples show how to use org.nd4j.linalg.util.ArrayUtil#toFloats() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CudaDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(int[] data) {
    return new CudaFloatDataBuffer(ArrayUtil.toFloats(data));
}
 
Example 2
Source File: CudaDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(double[] data) {
    return new CudaFloatDataBuffer(ArrayUtil.toFloats(data));
}
 
Example 3
Source File: CudaDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(int[] data, boolean copy) {
    return new CudaFloatDataBuffer(ArrayUtil.toFloats(data));
}
 
Example 4
Source File: CudaDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(double[] data, boolean copy) {
    return new CudaFloatDataBuffer(ArrayUtil.toFloats(data));
}
 
Example 5
Source File: DefaultDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(long offset, int[] data) {
    FloatBuffer ret = new FloatBuffer(ArrayUtil.toFloats(data), true, offset);
    return ret;
}
 
Example 6
Source File: DefaultDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(long offset, double[] data) {
    return new FloatBuffer(ArrayUtil.toFloats(data), true, offset);
}
 
Example 7
Source File: DefaultDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(long offset, int[] data, boolean copy) {
    return new FloatBuffer(ArrayUtil.toFloats(data), copy, offset);
}
 
Example 8
Source File: DefaultDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(long offset, double[] data, boolean copy) {
    return new FloatBuffer(ArrayUtil.toFloats(data), copy, offset);
}
 
Example 9
Source File: DefaultDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(int[] data, boolean copy) {
    return new FloatBuffer(ArrayUtil.toFloats(data), copy);
}
 
Example 10
Source File: DefaultDataBufferFactory.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public DataBuffer createFloat(double[] data, boolean copy) {
    return new FloatBuffer(ArrayUtil.toFloats(data), copy);
}