diff --git a/python/paddle/trainer/config_parser.py b/python/paddle/trainer/config_parser.py index 2d1b4a3b30c50fe3808cd754386667cedeac7a19..2f96d6fc0bc19f7fa1922b25eb89b3d3535f8bde 100644 --- a/python/paddle/trainer/config_parser.py +++ b/python/paddle/trainer/config_parser.py @@ -1988,16 +1988,11 @@ class PadLayer(LayerBase): @config_layer('crop') class CropLayer(LayerBase): - def __init__(self, inputs, axis, offset, shape, name, **xargs): + def __init__(self, name, inputs, axis, offset, shape, **xargs): super(CropLayer, self).__init__(name, 'crop', 0, inputs=inputs, **xargs) - self.conf.axis = axis - self.conf.axis = offset - self.conf.axis = shape - - crop = self.inputs[0].crop - self.config.inputs[0].crop_conf.axis = crop.axis - self.config.inputs[0].crop_conf.offset.extend(crop.offset) - self.config.inputs[0].crop_conf.shape.extend(crop.shape) + self.config.axis = axis + self.config.offset.extend(offset) + self.config.shape.extend(shape) # get channel, width and height from input_0 layer input_layer = self.get_input_layer(0)