All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nd4j.linalg.compression.NDArrayCompressor Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.nd4j.linalg.compression;

import org.nd4j.linalg.api.buffer.DataBuffer;
import org.nd4j.linalg.api.ndarray.INDArray;

/**
 * @author [email protected]
 */
public interface NDArrayCompressor {

    /**
     * This method returns compression descriptor. It should be unique for any compressor implementation
     * @return
     */
    String getDescriptor();

    /**
     * This method returns compression type provided by specific NDArrayCompressor implementation
     * @return
     */
    CompressionType getCompressionType();

    /**
     * This method returns compressed copy of referenced array
     *
     * @param array
     * @return
     */
    INDArray compress(INDArray array);

    /**
     * Inplace compression of INDArray
     *
     * @param array
     */
    void compressi(INDArray array);

    DataBuffer compress(DataBuffer buffer);

    /**
     * This method returns decompressed copy of referenced array
     *
     * @param array
     * @return
     */
    INDArray decompress(INDArray array);

    /**
     * Inplace decompression of INDArray
     *
     * @param array
     */
    void decompressi(INDArray array);

    DataBuffer decompress(DataBuffer buffer);


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy