From a063fc28b6993cb59d8eb66ecce8521360314f0b Mon Sep 17 00:00:00 2001 From: guosheng Date: Fri, 9 Feb 2018 14:31:12 +0800 Subject: [PATCH] Fix the bias of fc when num_flatten_dims is not 1 in fluid layers --- python/paddle/v2/fluid/layers/nn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/v2/fluid/layers/nn.py b/python/paddle/v2/fluid/layers/nn.py index 99168ecc22..eaf02ff589 100644 --- a/python/paddle/v2/fluid/layers/nn.py +++ b/python/paddle/v2/fluid/layers/nn.py @@ -184,7 +184,7 @@ def fc(input, helper.append_op( type="sum", inputs={"X": mul_results}, outputs={"Out": pre_bias}) # add bias - pre_activation = helper.append_bias_op(pre_bias) + pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims) # add activation return helper.append_activation(pre_activation) -- GitLab