diff --git a/python/paddle/trainer/config_parser.py b/python/paddle/trainer/config_parser.py index b342a90fb63429aed6c5f3b3d39a1e7e6653d9b5..9ec6ba6347ba9f52d3591d5cd2bb08c39e46e185 100644 --- a/python/paddle/trainer/config_parser.py +++ b/python/paddle/trainer/config_parser.py @@ -3863,17 +3863,17 @@ class SwitchOrderLayer(LayerBase): if reshape is None: self.set_layer_size(input_layer.size) else: - inH = input_layer.height - inW = input_layer.width + in_h = input_layer.height + in_w = input_layer.width if input_layer.has_depth(): - inD = input_layer.depth - inC = input_layer.size / inH / inW / inD - out_dims = [0, inD, inH, inW, inC] + in_d = input_layer.depth + in_c = input_layer.size / in_h / in_w / in_d + out_dims = [0, in_d, in_h, in_w, in_c] size = reduce(lambda x, y: x * y, out_dims[reshape['width'][0]:]) else: - inC = input_layer.size / inH / inW - out_dims = [0, inH, inW, inC] + in_c = input_layer.size / in_h / in_w + out_dims = [0, in_h, in_w, in_c] size = reduce(lambda x, y: x * y, out_dims[reshape['width'][0]:])