mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
If the operator produces a zero size tensor, the memory may be equal to the original. With nonzero, we would sometimes get unlucky and everything was zero. See failing tests at https://hud.pytorch.org/failure/%5B%20%20FAILED%20%20%5D%20StaticRuntime.Nonzero Arguably we should also fix the seeding but it was less obvious to me where to do that. Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/94418 Approved by: https://github.com/albanD