Incorrect handling of bias_attr for fc and other layers
Created by: emailweixu
According to the comment of nn.fc, if bias_attr is None, which is the default, there will be no bias for the layer. https://github.com/PaddlePaddle/Paddle/blob/f82fa64a06f71700a99b641aeb8fc9ef16c0d940/python/paddle/v2/fluid/layers/nn.py#L135-L137
However, bias is still added to the computation even it is not set. This is caused by a bug of LayerHelper.append_bias_op(). It checks for whether bias_attr is defined at the following line: https://github.com/PaddlePaddle/Paddle/blob/f82fa64a06f71700a99b641aeb8fc9ef16c0d940/python/paddle/v2/fluid/layer_helper.py#L357-L358 However, bias_attr is always defined because the property access function: https://github.com/PaddlePaddle/Paddle/blob/f82fa64a06f71700a99b641aeb8fc9ef16c0d940/python/paddle/v2/fluid/layer_helper.py#L72-L74
So there is no way not to use bias for fc layer (and other layers using same mechanism). It's easy to fix it. However, there are tuned models implicitly depending on the unexpected bug. If we fix this, we need to re-check the training of existing trained models.