diff --git a/caffe2fluid/kaffe/custom_layers/normalize.py b/caffe2fluid/kaffe/custom_layers/normalize.py index f6e8c00fb126009c5724fa6509c32c2b8c96bace..787fcc7643cc2d374fedddcd8a2d8a1c0a65238c 100644 --- a/caffe2fluid/kaffe/custom_layers/normalize.py +++ b/caffe2fluid/kaffe/custom_layers/normalize.py @@ -47,7 +47,8 @@ def normalize_layer(input, scale_attr = fluid.ParamAttr(name=param_prefix + '_scale') scale_param = fluid.layers.create_parameter( shape=shape, dtype=input.dtype, name=name, attr=scale_attr) - + scale_param = fluid.layers.reshape(x=scale_param, \ + shape=[1] if channel_shared else [input_shape[0][1]]) out = fluid.layers.elementwise_mul( x=l2_norm, y=scale_param, axis=-1 if channel_shared else 1) return out