Paddle
Paddle copied to clipboard
usage of "bias_attr" in implementations of several ops in Fluid
It seems that several operators in fluid (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py) take bias_attr as an argument, ~~but don't use it in the implementation of the function at all.~~
For instance the following layers(ops) have bias_attr,
- "fc"(https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L25)
- "dynamic_lstm" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L188)
- "sequence conv" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L580)
- "conv_2d" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L623)
- "batch_norm" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L935)
- "lstm_unit" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L1192)
~~But only "dynamic_lstm" and "lstm_unit" take it into account in the implementation, and remaining do not.~~
~~Can anyone please explain why is this the case? (I think this seems odd to include an argument if it is not being used.)~~
A related issue #7182 (just highlighting problem with batch_norm).
I missed the **locals() in the implementation. Sorry.