pytorch
2e02e1ef - Skip nonzero unbacked SymInt memo in inference mode (#122147)

Commit
1 year ago
Skip nonzero unbacked SymInt memo in inference mode (#122147) Summary: In `torch.inference_mode()`, fake tensors don't have `_version`s. This breaks unbacked SymInt memoization in `torch.nonzero` tracing. Here we disable the latter in inference mode. Fixes https://github.com/pytorch/pytorch/issues/122127 Test Plan: ``` $ python test/inductor/test_unbacked_symints.py -k test_nonzero_in_inference_mode ... ---------------------------------------------------------------------- Ran 2 tests in 14.060s OK ``` Reviewers: Subscribers: Tasks: Tags: Pull Request resolved: https://github.com/pytorch/pytorch/pull/122147 Approved by: https://github.com/ezyang
Author
Committer
Parents
Loading