diff --git a/tests/python/relay/test_op_level10.py b/tests/python/relay/test_op_level10.py index 040fa3fb4315..0eddd965c661 100644 --- a/tests/python/relay/test_op_level10.py +++ b/tests/python/relay/test_op_level10.py @@ -608,7 +608,7 @@ def _verify(prediction_shape, reduction="mean", ignore_index=-100, dtype="float3 for kind in ["graph", "debug"]: intrp = relay.create_executor(kind, device=dev, target=target) out_relay = intrp.evaluate(func)(predictions_np, targets_np, weights_np) - tvm.testing.assert_allclose(out_relay.asnumpy(), out_np) + tvm.testing.assert_allclose(out_relay.asnumpy(), out_np, rtol=1e-4, atol=1e-5) _verify((10, 5)) _verify((10, 5, 2, 2)) diff --git a/tests/python/topi/python/test_topi_loss.py b/tests/python/topi/python/test_topi_loss.py index 7fd8238bf0ae..c2db8bebc0f5 100644 --- a/tests/python/topi/python/test_topi_loss.py +++ b/tests/python/topi/python/test_topi_loss.py @@ -53,7 +53,7 @@ def verify_nll_loss( out_nd = tvm.nd.array(np.empty(out_npy.shape).astype(nll_loss_result.dtype), dev) fn(predictions_nd, targets_nd, weights_nd, out_nd) out_topi = out_nd.asnumpy() - tvm.testing.assert_allclose(out_topi, out_npy) + tvm.testing.assert_allclose(out_topi, out_npy, rtol=1e-4, atol=1e-5) @tvm.testing.parametrize_targets