Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

usage of "bias_attr" in implementations of several ops in Fluid

Open sidgoyal78 opened this issue 8 years ago • 1 comments

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,

  1. "fc"(https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L25)
  2. "dynamic_lstm" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L188)
  3. "sequence conv" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L580)
  4. "conv_2d" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L623)
  5. "batch_norm" (https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/layers/nn.py#L935)
  6. "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).

sidgoyal78 avatar Jan 08 '18 03:01 sidgoyal78

I missed the **locals() in the implementation. Sorry.

sidgoyal78 avatar Jan 08 '18 03:01 sidgoyal78