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

 ##########
 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:
   this test only covers int32 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:
[email protected]


With regards,
Apache Git Services

Reply via email to