public static INDArray readFromDisk ( File readFrom ) throws IOException { try ( FileInputStream os = new FileInputStream ( readFrom ) ) { FileChannel channel = os . getChannel ( ) ; ByteBuffer buffer = ByteBuffer . allocateDirect ( ( int ) readFrom . length ( ) ) ; channel . read ( buffer ) ; INDArray ret = toArray ( buffer ) ; return ret ; } }
Read an ndarray from disk