[dynamo] Dont guard on getset descriptors for torch_function (#166346)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/166346
Approved by: https://github.com/mlazos
ghstack dependencies: #166329
This commit is contained in:
Animesh Jain 2025-10-27 15:37:15 -07:00 committed by PyTorch MergeBot
parent 65868156c6
commit 02095cc09d

View File

@ -583,12 +583,6 @@ class TensorWithTFOverrideVariable(TensorVariable):
):
args, kwargs = [self], {}
if can_dispatch_torch_function(tx, args, kwargs):
if self.source:
install_guard(
AttrSource(
AttrSource(self.source, "__class__"), name
).make_guard(GuardBuilder.CLOSURE_MATCH)
)
get_fn = VariableTracker.build(tx, getattr(torch.Tensor, name).__get__)
return self.call_torch_function(