/** * This method returns compressed INDArray instance which contains JVM array passed in * * @param array * @return */ public INDArray compress(double[] array) { return codecs.get(defaultCompression).compress(array); } }
/** * Store object into storage * * @param key * @param object */ @Override public void store(T key, INDArray object) { INDArray toStore; if (useInplaceCompression) { compressor.compressi(object); toStore = object; } else { toStore = compressor.compress(object); } if (emulateIsAbsent) lock.writeLock().lock(); compressedEntries.put(key, toStore); if (emulateIsAbsent) lock.writeLock().unlock(); }
/** * This method returns compressed INDArray instance which contains JVM array passed in * * @param array * @return */ public INDArray compress(float[] array) { return codecs.get(defaultCompression).compress(array); }
/** * Store object into storage * * @param key * @param object */ @Override public void store(T key, INDArray object) { INDArray toStore; if (useInplaceCompression) { compressor.compressi(object); toStore = object; } else { toStore = compressor.compress(object); } if (emulateIsAbsent) lock.writeLock().lock(); compressedEntries.put(key, toStore); if (emulateIsAbsent) lock.writeLock().unlock(); }
/** * Store object into storage * * @param key * @param array */ @Override public void store(T key, float[] array) { INDArray toStore = compressor.compress(array); if (emulateIsAbsent) lock.writeLock().lock(); compressedEntries.put(key, toStore); if (emulateIsAbsent) lock.writeLock().unlock(); }
/** * Returns a compressed version of the * given ndarray * @param array the array to compress * @param algorithm the algorithm to compress with * @return a compressed copy of this ndarray */ public INDArray compress(INDArray array, String algorithm) { algorithm = algorithm.toUpperCase(); if (!codecs.containsKey(algorithm)) throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]"); return codecs.get(algorithm).compress(array); }
/** * Compress the data buffer * given a specified algorithm * @param buffer the buffer to compress * @param algorithm the algorithm to compress * use * @return the compressed data buffer */ public DataBuffer compress(DataBuffer buffer, String algorithm) { algorithm = algorithm.toUpperCase(); if (!codecs.containsKey(algorithm)) throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]"); return codecs.get(algorithm).compress(buffer); }
/** * Store object into storage * * @param key * @param array */ @Override public void store(T key, double[] array) { INDArray toStore = compressor.compress(array); if (emulateIsAbsent) lock.writeLock().lock(); compressedEntries.put(key, toStore); if (emulateIsAbsent) lock.writeLock().unlock(); }
/** * This method returns compressed INDArray instance which contains JVM array passed in * * @param array * @return */ public INDArray compress(float[] array) { return codecs.get(defaultCompression).compress(array); }
/** * This method returns compressed INDArray instance which contains JVM array passed in * * @param array * @return */ public INDArray compress(double[] array) { return codecs.get(defaultCompression).compress(array); } }
/** * Returns a compressed version of the * given ndarray * @param array the array to compress * @param algorithm the algorithm to compress with * @return a compressed copy of this ndarray */ public INDArray compress(INDArray array, String algorithm) { algorithm = algorithm.toUpperCase(); if (!codecs.containsKey(algorithm)) throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]"); return codecs.get(algorithm).compress(array); }
/** * Compress the data buffer * given a specified algorithm * @param buffer the buffer to compress * @param algorithm the algorithm to compress * use * @return the compressed data buffer */ public DataBuffer compress(DataBuffer buffer, String algorithm) { algorithm = algorithm.toUpperCase(); if (!codecs.containsKey(algorithm)) throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]"); return codecs.get(algorithm).compress(buffer); }
/** * Store object into storage * * @param key * @param array */ @Override public void store(T key, float[] array) { INDArray toStore = compressor.compress(array); if (emulateIsAbsent) lock.writeLock().lock(); compressedEntries.put(key, toStore); if (emulateIsAbsent) lock.writeLock().unlock(); }
/** * Store object into storage * * @param key * @param array */ @Override public void store(T key, double[] array) { INDArray toStore = compressor.compress(array); if (emulateIsAbsent) lock.writeLock().lock(); compressedEntries.put(key, toStore); if (emulateIsAbsent) lock.writeLock().unlock(); }