viable/strict/1788542608: [dynamo] Migrate NNModuleVariable methods to tp_methods (#195193)
The migration moves NNModuleVariable named methods onto declarative tp_methods, aligning with the Dynamo design. It keeps call_method for the Dynamo-internal constant path and the all-tensor FX-proxy heuristic to keep getattr and unlisted methods on the same path.
Additionally, __contains__ and in now consult the module’s own __contains__ implementation, reflecting that ParameterDict keys live in _keys, not _modules. This work is part of issue #195165 and PR #195193, with tests validating the changes.
Why it matters: Clarifies method dispatch and containment behavior for NNModuleVariable, improving Dynamo consistency and test coverage. This enables safer migration toward tp_methods and maintains internal paths used by Dynamo.
AI-assisted brief
official source
Add a comment
No account required