Compare commits

...

1 Commits

Author SHA1 Message Date
3494fa6450 Invalidate eager params when inlining and freezing nn modules
ghstack-source-id: ff6accb12cfa713414d2d552d6fe000da151b566
Pull Request resolved: https://github.com/pytorch/pytorch/pull/128543
2024-06-12 12:34:49 -07:00

View File

@ -1141,6 +1141,11 @@ class VariableBuilder:
for b in value.buffers():
mark_static_address(b)
# we need to add the module to tracing context
# in order to allow its params to get invalidated
# this will get cleaned up once compile ends
self.tx.output.nn_modules[self.name] = value
result = UnspecializedNNModuleVariable(value, source=self.source)
if not SideEffects.cls_supports_mutation_side_effects(type(value)):
# don't allow STORE_ATTR mutation with custom __setattr__