From fec0cd92bf1c2d7dfed4b5b4c36b9a6f6bc36826 Mon Sep 17 00:00:00 2001 From: Anatoly Rubanov Date: Tue, 27 Feb 2024 18:43:15 +0300 Subject: [PATCH 1/2] Reduce chance to fail for test case --- tests/test_pytensorf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_pytensorf.py b/tests/test_pytensorf.py index 217d63be6e..1cbed44d46 100644 --- a/tests/test_pytensorf.py +++ b/tests/test_pytensorf.py @@ -694,7 +694,8 @@ def test_replace_vars_in_graphs_nested_reference(): # Confirm the original `y` variable is changed in place # This is unavoidable if we want to respect the identity of the replacement variables # As when imputing `neg_x` and `x` while evaluating `new_y` above and below. - assert np.abs(y.eval({x_value: 100})) > 1 + # This assertion could fail with probability 1/10000 when y is drawn in -1, 1 range. + assert np.abs(y.eval({x_value: 10000})) > 1 # Only replace `y`, same replacement as before x = pm.HalfNormal.dist(1e-3, name="x") From a7a9ae0b10acc433032efa557de73bf9c91444f7 Mon Sep 17 00:00:00 2001 From: Anatoly <44327258+aerubanov@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:56:50 +0300 Subject: [PATCH 2/2] Update tests/test_pytensorf.py Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com> --- tests/test_pytensorf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pytensorf.py b/tests/test_pytensorf.py index 1cbed44d46..29f53808e8 100644 --- a/tests/test_pytensorf.py +++ b/tests/test_pytensorf.py @@ -694,7 +694,7 @@ def test_replace_vars_in_graphs_nested_reference(): # Confirm the original `y` variable is changed in place # This is unavoidable if we want to respect the identity of the replacement variables # As when imputing `neg_x` and `x` while evaluating `new_y` above and below. - # This assertion could fail with probability 1/10000 when y is drawn in -1, 1 range. + # This assertion could fail with probability 1/10000 assert np.abs(y.eval({x_value: 10000})) > 1 # Only replace `y`, same replacement as before