From 661b2da331131c9dff97fb1751aef3f7d59ff849 Mon Sep 17 00:00:00 2001 From: SunAhong1993 Date: Wed, 4 Sep 2019 17:11:18 +0800 Subject: [PATCH] fix the normilize --- caffe2fluid/kaffe/custom_layers/normalize.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/caffe2fluid/kaffe/custom_layers/normalize.py b/caffe2fluid/kaffe/custom_layers/normalize.py index f6e8c00..787fcc7 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 -- GitLab