Skip to content

Commit

Permalink
Make test_mandelbrot_numpy deterministic
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

ghstack-source-id: bc02eede666cb882b89ff496327005cbf04adabd
Pull Request resolved: #112042
  • Loading branch information
lezcano committed Oct 25, 2023
1 parent 28ebe5d commit 1b873dd
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 1b873dd

Please sign in to comment.