chore: fix random test failures

This commit is contained in:
Umut
2022-12-05 11:26:11 +01:00
parent 23337e9dbd
commit 65f0e251f0
2 changed files with 2 additions and 2 deletions

View File

@@ -297,7 +297,7 @@ def test_bad_server_save(helpers):
@pytest.mark.parametrize("p_error", [0.5, 0.1, 0.01])
@pytest.mark.parametrize("bit_width", [10])
@pytest.mark.parametrize("sample_size", [100_000])
@pytest.mark.parametrize("tolerance", [0.05])
@pytest.mark.parametrize("tolerance", [0.075])
def test_virtual_p_error(p_error, bit_width, sample_size, tolerance, helpers):
"""
Test virtual circuits with p_error.

View File

@@ -162,7 +162,7 @@ def test_auto_rounding(helpers):
# we have 4-bit inputs for this table, and we only want to use first 2-bits
for i in range(0, 2**4, 2**2):
# so we set every 4th entry to an 8-bit value
entries4[i] = np.random.randint(0, 2**8)
entries4[i] = np.random.randint(2**7, 2**8)
# when this tlu is applied to a 4-bit value with 2-bit msb rounding, result will be 8-bits
table4 = cnp.LookupTable(entries4)
# and this is the rounder for table2, which should have lsbs_to_remove of 2