Took a look into the code, I guess this is a bug in:
/nn/modules/container.py
def __getitem__(self, idx: int) -> Module:
if isinstance(idx, slice):
return self.__class__(list(self._modules.values())[idx])
else:
return self._modules[self._get_abs_string_index(idx)]
The return type is actually not Module but Union[Module, ‘ModuleList’].
Should I open a PR for this?