未验证 提交 58e465aa 编写于 作者: C chentianyu03 提交者: GitHub

replace six lib in container file (#33775)

上级 eb529128
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
from collections import OrderedDict from collections import OrderedDict
from ...fluid.dygraph.layers import Layer from ...fluid.dygraph.layers import Layer
from six.moves import collections_abc from collections.abc import Iterable, Mapping
__all__ = [] __all__ = []
...@@ -276,12 +276,11 @@ class LayerDict(Layer): ...@@ -276,12 +276,11 @@ class LayerDict(Layer):
""" """
assert isinstance( assert isinstance(
sublayers, collections_abc.Iterable sublayers, Iterable
), "The type of sublayers is not iterable of key/value pairs, the type of sublayers is " + type( ), "The type of sublayers is not iterable of key/value pairs, the type of sublayers is " + type(
sublayers).__name__ sublayers).__name__
if isinstance(sublayers, if isinstance(sublayers, (OrderedDict, LayerDict, Mapping)):
(OrderedDict, LayerDict, collections_abc.Mapping)):
for key, layer in sublayers.items(): for key, layer in sublayers.items():
self.add_sublayer(key, layer) self.add_sublayer(key, layer)
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册