Skip to content

Commit

Permalink
fix sequential bug about key error, test=develop (#39372)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuancoder authored Feb 8, 2022
1 parent 6d4d774 commit 0fee004
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/paddle/fluid/dygraph/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __getitem__(self, name):
name += len(self._sub_layers)
elif name < -len(self._sub_layers):
raise IndexError('index {} is out of range'.format(name))
return self._sub_layers[str(name)]
return list(self._sub_layers.values())[name]

def __setitem__(self, name, layer):
assert isinstance(layer, Layer)
Expand Down

0 comments on commit 0fee004

Please sign in to comment.