From 69b12225cc19919005d4cc1b4bb814a93ad205b3 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Tue, 11 Jul 2017 10:15:48 +0800 Subject: [PATCH] fix crop layer python wrapper bug --- python/paddle/trainer/config_parser.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/python/paddle/trainer/config_parser.py b/python/paddle/trainer/config_parser.py index 2d1b4a3b3..2f96d6fc0 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) -- GitLab