Skip to content

Commit

Permalink
RF ModuleList setitem small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed Nov 9, 2023
1 parent 5db7847 commit f4c457e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion returnn/frontend/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __setitem__(self, idx: Union[slice, int], module: Union[__ModT, Iterable[__M
# Delete also remaining, and then re-add them later, such that indices are correct.
for k, _ in mod_items[idx.start :]:
delattr(self, k)
i = idx.start
i = idx.start or 0
for mod_ in module:
assert not hasattr(self, str(i))
setattr(self, str(i), _convert_to_module(mod_))
Expand Down

0 comments on commit f4c457e

Please sign in to comment.