pytorch
e9c1ccee - Bug fix: allow std 0 in the meta definition of `normal_` (#70085)

Commit
2 years ago
Bug fix: allow std 0 in the meta definition of `normal_` (#70085) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/70085 All other `normal` variants allow 0. Looks like a mistake made while copying the check. Even the `normal_` implementation disagrees: ``` >>> t = torch.rand(2, 3, device='meta') >>> t.normal_(mean=4, std=0) Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: normal_ expects std > 0.0, but found std=0 >>> >>> >>> t = torch.rand(2, 3) >>> t.normal_(mean=4, std=0) tensor([[4., 4., 4.], [4., 4., 4.]]) ``` Fixes #69523. Test Plan: Imported from OSS Reviewed By: davidberard98 Differential Revision: D34089967 Pulled By: bdhirsh fbshipit-source-id: c57963e55f06c9513c4f0839f8f7a21eca86b584 (cherry picked from commit d6ffe43ddddd24daa5d9eb8befc852dd2108fc89)
Author
Committer
Parents
Loading