Skip to content

Commit

Permalink
[TOPI] Specify non-zero absolute tolerance in tests (apache#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-mironov authored and tqchen committed Oct 21, 2018
1 parent 6500bb3 commit 9ab4128
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/python/integration/test_benchmark_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def verify(s, check_correctness=True):
env.BATCH,
env.BLOCK_OUT)
if check_correctness:
np.testing.assert_allclose(res_unpack, res_ref)
tvm.testing.assert_allclose(res_unpack, res_ref)
return cost

def run_schedule(load_inp,
Expand Down
4 changes: 2 additions & 2 deletions tests/python/integration/test_benchmark_topi_conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def verify(s, check_correctness):
padding = wl.hpad
res_ref = res_ref >> 8
res_ref = np.clip(res_ref, 0, 127).astype("int8")
np.testing.assert_allclose(res_unpack, res_ref)
tvm.testing.assert_allclose(res_unpack, res_ref)
return cost

def conv_normal(print_ir):
Expand Down Expand Up @@ -219,7 +219,7 @@ def verify(s, check_correctness):
res_ref = res_ref >> 8
res_ref += bias_orig.reshape(wl.out_filter, 1, 1)
res_ref = np.clip(res_ref, 0, 127).astype("int8")
np.testing.assert_allclose(res_unpack, res_ref)
tvm.testing.assert_allclose(res_unpack, res_ref)
return cost

def conv_normal(print_ir):
Expand Down
2 changes: 1 addition & 1 deletion tutorials/convolution_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
env.BLOCK_OUT,
fout_height,
fout_width)).transpose((0, 2, 4, 5, 1, 3))
np.testing.assert_allclose(res_ref, res_nd.asnumpy())
tvm.testing.assert_allclose(res_ref, res_nd.asnumpy())
print("Successful 2D convolution test!")

######################################################################
Expand Down

0 comments on commit 9ab4128

Please sign in to comment.