public static void writeArrayToDisk ( INDArray arr , File toWrite ) throws IOException { try ( FileOutputStream os = new FileOutputStream ( toWrite ) ) { FileChannel channel = os . getChannel ( ) ; ByteBuffer buffer = BinarySerde . toByteBuffer ( arr ) ; channel . write ( buffer ) ; } }
Write an ndarray to disk in binary format