mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Previously `TestGradient.test_second_order_accurate` was failing because of a small tolerance error (0.03... which is above the 0.03 tolerance). Upon investigating, `np.random.random` caused some divergence between eager and compiled randomness because in compiled we are not using `np.random`'s random seed, rather we end up using `torch`'s. This in turn caused numerical divergence and aforementioned accuracy issue. This patch fixes the failure by patching the test case with `use_numpy_random_stream=True`, which forces a graph break on `np.random.random()` and thereby falling back to eager to ensure consistency of the numpy randomness. Fixes #116746. Pull Request resolved: https://github.com/pytorch/pytorch/pull/145293 Approved by: https://github.com/lezcano |
||
|---|---|---|
| .. | ||
| test_arraypad.py | ||
| test_arraysetops.py | ||
| test_function_base.py | ||
| test_histograms.py | ||
| test_index_tricks.py | ||
| test_shape_base_.py | ||
| test_twodim_base.py | ||
| test_type_check.py | ||