You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/12/26 05:44:27 UTC

[GitHub] [incubator-mxnet] ciyongch commented on a change in pull request #17166: [MKLDNN] fix int8 elemwise add ut

ciyongch commented on a change in pull request #17166: [MKLDNN] fix int8 elemwise add ut
URL: https://github.com/apache/incubator-mxnet/pull/17166#discussion_r361372906
 
 

 ##########
 File path: tests/python/quantization/test_quantization.py
 ##########
 @@ -328,12 +328,11 @@ def check_quantized_elemwise_add(data_shape, qtype):
         elemwise_add_int8_exe.arg_dict[qarg_names[4]][:] = data_low
         elemwise_add_int8_exe.arg_dict[qarg_names[5]][:] = data_high
         qoutput, min_range, max_range = elemwise_add_int8_exe.forward()
-        min_val = min_range.asnumpy().tolist()[0]
-        max_val = max_range.asnumpy().tolist()[0]
 
-        fp32_rslt = output.asnumpy()
-        int8_rslt = qoutput.asnumpy()*max_val/0x7fffffff
-        assert_almost_equal(int8_rslt, int8_rslt, atol = 1e-4)
+        int8_rslt = qoutput.astype(output.dtype)*max_range/0x7fffffff
 
 Review comment:
   How this factor works for both `INT32` and `INT8`output?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services