Revert "[dynamo] allow global import from collections import deque in user code (#148676)"

This reverts commit 685fb377131cc684633dc5471e77038988db53f6.

Reverted https://github.com/pytorch/pytorch/pull/148676 on behalf of https://github.com/malfet due to Looks like it broke ROCM, see f1444f006c/1(default%2C%201&mergeLF=true ([comment](https://github.com/pytorch/pytorch/pull/148676#issuecomment-2709057326))
This commit is contained in:
PyTorch MergeBot
2025-03-09 20:42:03 +00:00
parent f1444f006c
commit 19a39a7a06
3 changed files with 10 additions and 86 deletions

View File

@ -563,6 +563,7 @@ class DequeVariable(CommonListMethodsVariable):
)
def reconstruct(self, codegen: "PyCodegen") -> None:
assert "deque" not in codegen.tx.f_globals
codegen.add_push_null(
lambda: codegen.append_output(
codegen.create_load_python_module(collections.deque)