/** * In place Compress the given ndarray * with the given algorithm * @param array the array to compress * @param algorithm */ public void compressi(INDArray array, String algorithm) { algorithm = algorithm.toUpperCase(); if (!codecs.containsKey(algorithm)) throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]"); codecs.get(algorithm).compressi(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(); }
/** * In place Compress the given ndarray * with the given algorithm * @param array the array to compress * @param algorithm */ public void compressi(INDArray array, String algorithm) { algorithm = algorithm.toUpperCase(); if (!codecs.containsKey(algorithm)) throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]"); codecs.get(algorithm).compressi(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(); }