aksnzhy commented on issue #7512: Add two bit compression operator
URL: https://github.com/apache/incubator-mxnet/pull/7512#issuecomment-325742223
 
 
   Update the Usage:
   
   >>> array = mx.nd.array([-6, -2, 3, 1, 10, 5, -3, 2, -8, 0])
   >>> residual = mx.nd.array([-3, 1, -1, 5, -2, 2, 3, -7, -2, -100])
   >>> min = mx.nd.array([-4.0])
   >>> max = mx.nd.array([4.0])
   >>> out = mx.contrib.ndarray.create_2bit(array)
   >>> mx.contrib.ndarray.quantize_2bit(array, residual, min, max, out)
   >>> out
   
   [ -4.00000000e+00   4.00000000e+00   7.40468810e-39]
   <NDArray 3 @cpu(0)>
   
   >>> mx.contrib.ndarray.dequantize_2bit(out, array)
   >>> array
   
   [-4.  0.  0.  4.  4.  4.  0. -4. -4. -4.]
   <NDArray 10 @cpu(0)>
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to