Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api2.0 paddle.nn.Bilinear and paddle.nn.functional.bilinear #26399

Merged
merged 10 commits into from
Aug 24, 2020
Merged

api2.0 paddle.nn.Bilinear and paddle.nn.functional.bilinear #26399

merged 10 commits into from
Aug 24, 2020

Conversation

wanghuancoder
Copy link
Contributor

@wanghuancoder wanghuancoder commented Aug 18, 2020

PR types

New features

PR changes

APIs

Describe

一、背景
API2.0专项。
paddle.nn.Bilinear。
paddle.nn.functional.bilinear。
对应的老版本API:paddle.nn.BilinearTensorProduct

二、主要修改点:

  1. 修改API名称、参数。forward参数与张军讨论后修改为:forward(self, x1, x2)
  2. 添加paddle.nn.functional.bilinear函数
  3. 添加in_dygraph_mode分支,处理动态图逻辑
  4. 修改op_function_generator.cc,用于修改bilinear_tensor_product OP对外暴露参数
  5. 修改英文文档
  6. 添加单测

三、主要测试点

  1. float32、float64两周类型
  2. paddle.nn.Bilinear 动态图、静态图
  3. paddle.nn.functional.bilinear 动态图、静态图
  4. paddle.nn.functional.bilinear bias、name为None情况测试

四、未测试点

  1. paddle.nn.Bilinear weight_attr、bias_attr、name始终使用None,没有传入过参数

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

zhiqiu
zhiqiu previously approved these changes Aug 18, 2020
Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for op_function_generator.cc

iclementine
iclementine previously approved these changes Aug 19, 2020
Copy link

@iclementine iclementine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

jzhang533
jzhang533 previously approved these changes Aug 21, 2020
Copy link
Contributor

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will merge
followup:
deprecate BilinearTensorProduct

'ConstantPad3d',
'ReplicationPad3d',
'CosineSimilarity',
'BilinearTensorProduct', 'Pool2D', 'Embedding', 'Linear', 'UpSample',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BilinearTensorProduct在这里可以直接删掉了。
相应的,
https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/fluid//dygraph/nn.py#L2356
这里可以加deprecated decorator。

lanxianghit
lanxianghit previously approved these changes Aug 21, 2020
@zhiqiu zhiqiu self-requested a review August 21, 2020 11:53
zhiqiu
zhiqiu previously approved these changes Aug 21, 2020
Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
todo:fix docs in another PR~

Copy link
Contributor

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (conflict resolved)

@chenwhql chenwhql merged commit 422a162 into PaddlePaddle:develop Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants