public class BasicNDArrayCompressor extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,NDArrayCompressor> |
codecs |
protected String |
defaultCompression |
Modifier and Type | Method and Description |
---|---|
void |
autoDecompress(INDArray... arrays)
Decompress several ndarrays
|
void |
autoDecompress(INDArray array) |
DataBuffer |
compress(DataBuffer buffer)
Compress the given data buffer
given the default compression algorithm
|
DataBuffer |
compress(DataBuffer buffer,
String algorithm)
Compress the data buffer
given a specified algorithm
|
INDArray |
compress(double[] array)
This method returns compressed INDArray instance which contains JVM array passed in
|
INDArray |
compress(float[] array)
This method returns compressed INDArray instance which contains JVM array passed in
|
INDArray |
compress(INDArray array) |
INDArray |
compress(INDArray array,
String algorithm)
Returns a compressed version of the
given ndarray
|
void |
compressi(INDArray array)
In place compression of the passed in ndarray
with the default compression algorithm
|
void |
compressi(INDArray array,
String algorithm)
In place Compress the given ndarray
with the given algorithm
|
DataBuffer |
decompress(DataBuffer buffer,
DataType targetType)
Decompress the given databuffer
|
INDArray |
decompress(INDArray array) |
void |
decompressi(INDArray array)
in place decompression of the given
ndarray.
|
Set<String> |
getAvailableCompressors()
Get the set of available codecs for
compression
|
NDArrayCompressor |
getCompressor(String name) |
String |
getDefaultCompression()
Get the default compression algorithm as a string.
|
static BasicNDArrayCompressor |
getInstance()
Get the ndarray compressor
singleton
|
protected void |
loadCompressors() |
void |
printAvailableCompressors()
Prints available compressors to standard out
|
BasicNDArrayCompressor |
setDefaultCompression(String algorithm)
Set the default compression algorithm
|
protected Map<String,NDArrayCompressor> codecs
protected String defaultCompression
protected void loadCompressors()
public Set<String> getAvailableCompressors()
public void printAvailableCompressors()
public static BasicNDArrayCompressor getInstance()
public BasicNDArrayCompressor setDefaultCompression(@NonNull String algorithm)
algorithm
- the algorithm to setpublic String getDefaultCompression()
public DataBuffer compress(DataBuffer buffer)
buffer
- the data buffer to compresspublic DataBuffer compress(DataBuffer buffer, String algorithm)
buffer
- the buffer to compressalgorithm
- the algorithm to compress
usepublic void compressi(INDArray array)
array
- public INDArray compress(INDArray array, String algorithm)
array
- the array to compressalgorithm
- the algorithm to compress withpublic void compressi(INDArray array, String algorithm)
array
- the array to compressalgorithm
- public DataBuffer decompress(DataBuffer buffer, DataType targetType)
buffer
- the databuffer to compresspublic NDArrayCompressor getCompressor(@NonNull String name)
public void decompressi(INDArray array)
array
- the array to decompressed
if it is comprssedpublic void autoDecompress(INDArray... arrays)
arrays
- public void autoDecompress(INDArray array)
array
- public INDArray compress(float[] array)
array
- public INDArray compress(double[] array)
array
- Copyright © 2019. All rights reserved.