/** * * @param array */ public void autoDecompress(INDArray array) { if (array.isCompressed()) decompressi(array); }
/** * Convert an ndarray to an unsafe buffer * for use by aeron * @param arr the array to convert * @return the unsafebuffer representation of this array */ public static ByteBuffer toByteBuffer(INDArray arr) { //subset and get rid of 1 off non 1 element wise stride cases if (arr.isView()) arr = arr.dup(); if (!arr.isCompressed()) { ByteBuffer b3 = ByteBuffer.allocateDirect(byteBufferSizeFor(arr)).order(ByteOrder.nativeOrder()); doByteBufferPutUnCompressed(arr, b3, true); return b3; } //compressed array else { ByteBuffer b3 = ByteBuffer.allocateDirect(byteBufferSizeFor(arr)).order(ByteOrder.nativeOrder()); doByteBufferPutCompressed(arr, b3, true); return b3; } }
@Override public void decompressi(INDArray array) { if (!array.isCompressed()) return; array.markAsCompressed(false); array.setData(decompress(array.data())); }
if (!arr.isCompressed()) { ByteBuffer buffer = arr.data().pointer().asByteBuffer().order(ByteOrder.nativeOrder()); ByteBuffer shapeBuffer = arr.shapeInfoDataBuffer().pointer().asByteBuffer().order(ByteOrder.nativeOrder());
protected void checkForCompression(Op op) { // check for INT datatype arrays interceptIntDataType(op); if (op.x() != null && op.x().isCompressed()) Nd4j.getCompressor().decompressi(op.x()); if (op.y() != null && op.y().isCompressed()) Nd4j.getCompressor().decompressi(op.y()); if (op.z() != null && op.z().isCompressed()) Nd4j.getCompressor().decompressi(op.z()); }
/** * * @param array */ public void autoDecompress(INDArray array) { if (array.isCompressed()) decompressi(array); }
/** * Convert an ndarray to an unsafe buffer * for use by aeron * @param arr the array to convert * @return the unsafebuffer representation of this array */ public static ByteBuffer toByteBuffer(INDArray arr) { //subset and get rid of 1 off non 1 element wise stride cases if (arr.isView()) arr = arr.dup(); if (!arr.isCompressed()) { ByteBuffer b3 = ByteBuffer.allocateDirect(byteBufferSizeFor(arr)).order(ByteOrder.nativeOrder()); doByteBufferPutUnCompressed(arr, b3, true); return b3; } //compressed array else { ByteBuffer b3 = ByteBuffer.allocateDirect(byteBufferSizeFor(arr)).order(ByteOrder.nativeOrder()); doByteBufferPutCompressed(arr, b3, true); return b3; } }
@Override public void decompressi(INDArray array) { if (!array.isCompressed()) return; array.markAsCompressed(false); array.setData(decompress(array.data())); }
if (message.getArr().isCompressed()) { AeronNDArraySerde.doByteBufferPutCompressed(message.getArr(), byteBuffer, false); } else {
if (!arr.isCompressed()) { ByteBuffer buffer = arr.data().pointer().asByteBuffer().order(ByteOrder.nativeOrder()); ByteBuffer shapeBuffer = arr.shapeInfoDataBuffer().pointer().asByteBuffer().order(ByteOrder.nativeOrder());
protected void checkForCompression(Op op) { // check for INT datatype arrays interceptIntDataType(op); if (op.x() != null && op.x().isCompressed()) Nd4j.getCompressor().decompressi(op.x()); if (op.y() != null && op.y().isCompressed()) Nd4j.getCompressor().decompressi(op.y()); if (op.z() != null && op.z().isCompressed()) Nd4j.getCompressor().decompressi(op.z()); }
while (!message.getArr().isCompressed()) Nd4j.getCompressor().compressi(arr, "GZIP");
if (toConcat[i].isCompressed()) Nd4j.getCompressor().decompressi(toConcat[i]);
if (toConcat[i].isCompressed()) Nd4j.getCompressor().decompressi(toConcat[i]);
@Override public INDArray[] tear(INDArray tensor, int... dimensions) { if (tensor.isCompressed()) Nd4j.getCompressor().decompressi(tensor);
public INDArray[] tear(INDArray tensor, int... dimensions) { if (tensor.isCompressed()) Nd4j.getCompressor().decompressi(tensor);
if (toConcat[i].isCompressed()) Nd4j.getCompressor().decompressi(toConcat[i]);
if (toConcat[i].isCompressed()) Nd4j.getCompressor().decompressi(toConcat[i]);