diff --git a/python/paddle/v2/topology.py b/python/paddle/v2/topology.py index 20fa891d656548be3414ae9e6610d1256d60b39c..9c57f1f8e607bd47e0c7eeef8a3222e1cb1ddb0e 100644 --- a/python/paddle/v2/topology.py +++ b/python/paddle/v2/topology.py @@ -32,8 +32,7 @@ class Topology(object): __check_layer_type__(layers) layers = [layers] for layer in layers: - if not isinstance(layer, v2_layer.LayerV2): - raise ValueError('layer should have type paddle.layer.Layer') + __check_layer_type__(layer) self.layers = layers self.__model_config__ = v2_layer.parse_network(*layers) assert isinstance(self.__model_config__, ModelConfig)