From 1c59321f947c6981d97fd49a1eff6e6206fc551e Mon Sep 17 00:00:00 2001 From: nikitaved Date: Wed, 24 Jul 2024 15:42:56 +0200 Subject: [PATCH] `test_autocast_torch_matmul`: fix flakiness (#851) --- thunder/tests/test_autocast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thunder/tests/test_autocast.py b/thunder/tests/test_autocast.py index e2c8e6fbbc..4ea8b1f3f2 100644 --- a/thunder/tests/test_autocast.py +++ b/thunder/tests/test_autocast.py @@ -255,7 +255,7 @@ def foo(a, b): torch.testing.assert_close(actual, expected) if requires_grad: - go = torch.randn_like(expected) + go = torch.ones_like(expected) / expected.numel() eager_grads = torch.autograd.grad(expected, [a, b], go) jit_grads = torch.autograd.grad(actual, [a, b], go)