Skip to content

Commit a085acd

Browse files
anijain2305pytorchmergebot
authored andcommitted
[dynamo] Revert back changes to UnspecializedBuiltinNNModuleVariable (pytorch#130991)
xref - https://fb.workplace.com/groups/1075192433118967/permalink/1466525440652329/ Pull Request resolved: pytorch#130991 Approved by: https://github.com/williamwen42, https://github.com/mlazos
1 parent 9f392f8 commit a085acd

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

torch/_dynamo/variables/builder.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,7 @@
177177
TorchVersionVariable,
178178
TypingVariable,
179179
)
180-
from .nn_module import (
181-
FSDPManagedNNModuleVariable,
182-
UnspecializedBuiltinNNModuleVariable,
183-
UnspecializedNNModuleVariable,
184-
)
180+
from .nn_module import FSDPManagedNNModuleVariable, UnspecializedNNModuleVariable
185181
from .optimizer import OptimizerVariable
186182
from .script_object import TorchScriptObjectVariable
187183

@@ -1278,10 +1274,7 @@ def wrap_module(self, value: torch.nn.Module):
12781274
# this will get cleaned up once compile ends
12791275
self.tx.output.nn_modules[self.name] = value
12801276

1281-
if value.__module__.startswith(("torch.nn.", "torch.ao.")):
1282-
result = UnspecializedBuiltinNNModuleVariable(value, source=self.source)
1283-
else:
1284-
result = UnspecializedNNModuleVariable(value, source=self.source)
1277+
result = UnspecializedNNModuleVariable(value, source=self.source)
12851278
if not SideEffects.cls_supports_mutation_side_effects(type(value)):
12861279
# don't allow STORE_ATTR mutation with custom __setattr__
12871280
return result

0 commit comments

Comments
 (0)