This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Description
I noticed that the old_state
variable of make_functional.py::FunctionalModuleWithBuffers::forward
is always full of None
elements. Digging a bit I saw that there is no return in the general case of _get_nested_attr
if len(names) == 1:
return getattr(obj, names[0])
else:
# No return here
_get_nested_attr(getattr(obj, names[0]), names[1:])
So the outermost call is always returning None
when len(names) > 1
. If I'm right and this is a bug what implications does it have? For instance, the "Remove the loaded state on self.stateless_model" step surely wouldn't be doing what it's supposed to.