Skip to content

Commit

Permalink
[easy] Make test_mandelbrot_numpy deterministic (pytorch#112042)
Browse files Browse the repository at this point in the history
It fails for me locally, and I'm not the only one:
https://dev-discuss.pytorch.org/t/main-failing-unit-test-dynamicshapesmisctests/1607

Pull Request resolved: pytorch#112042
Approved by: https://github.com/peterbell10
  • Loading branch information
lezcano authored and Skylion007 committed Nov 14, 2023
1 parent 9256873 commit 6e410b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/dynamo/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,8 +1682,8 @@ def mandelbrot_numpy(max_iter):
cnts = torch._dynamo.testing.CompileCounter()
opt_fn = torch._dynamo.optimize(cnts, nopython=True)(mandelbrot_numpy)
n_iter = torch._dynamo.config.cache_size_limit
for _ in range(n_iter):
x = random.randint(2, 30)
for i in range(n_iter):
x = i + 3
ref = mandelbrot_numpy(x)
res = opt_fn(x)
self.assertEqual(ref, res)
Expand Down

0 comments on commit 6e410b9

Please sign in to comment.