未验证 提交 0fee0044 编写于 作者: W wanghuancoder 提交者: GitHub

fix sequential bug about key error, test=develop (#39372)

上级 6d4d774d
...@@ -79,7 +79,7 @@ class Sequential(Layer): ...@@ -79,7 +79,7 @@ class Sequential(Layer):
name += len(self._sub_layers) name += len(self._sub_layers)
elif name < -len(self._sub_layers): elif name < -len(self._sub_layers):
raise IndexError('index {} is out of range'.format(name)) 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): def __setitem__(self, name, layer):
assert isinstance(layer, Layer) assert isinstance(layer, Layer)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册