未验证 提交 29e081bb 编写于 作者: W wanghuancoder 提交者: GitHub

fix a bug, test=develop (#32488)

上级 78fc74b0
......@@ -69,6 +69,8 @@ class Sequential(Layer):
def __getitem__(self, name):
if isinstance(name, slice):
return self.__class__(*(list(self._sub_layers.values())[name]))
elif isinstance(name, str):
return self._sub_layers[name]
else:
if name >= len(self._sub_layers):
raise IndexError('index {} is out of range'.format(name))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册