mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "Make torch.device usable as a context manager (#91525)"
This reverts commit 619d52a5d296bc236ac98f40c7f7de54ab7c9d37. Reverted https://github.com/pytorch/pytorch/pull/91525 on behalf of https://github.com/mehtanirav due to Internal breakages
This commit is contained in:
@ -760,7 +760,7 @@ class Wrapper:
|
||||
val = getattr(self._data, name)
|
||||
|
||||
# If it's a method
|
||||
if not isinstance(val, torch.device) and callable(val):
|
||||
if callable(val):
|
||||
c = getattr(type(self._data), name)
|
||||
# Don't append self to args if classmethod/staticmethod
|
||||
if c is val:
|
||||
|
Reference in New Issue
Block a user