layer_type = self.__class__.__name__
if isinstance(inputs, list) and len(inputs) > 1:
if layer_type not in ["Concat", "Res", "Scale", "Dense"]:
raise DLPyError("The input of {layer_type} should have only one layer.")
else:
inputs = [inputs]
self.src_layers = self.src_layers or []
self.src_layers = self.src_layers + inputs
After Change
layer_type = self.__class__.__name__
if isinstance(inputs, list):
if len(inputs) > 1 and layer_type not in ["Concat", "Res", "Scale", "Dense"]:
raise DLPyError("The input of {} should have only one layer.".format(layer_type))
else:
inputs = [inputs]
self.src_layers = self.src_layers or []
self.src_layers = self.src_layers + inputs