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

【不兼容升级】移除paddle.nn.functional.diag_embed,添加paddle.diag_embed并支持作为类方法 #58223

Merged

Conversation

xuxinyi389
Copy link
Contributor

@xuxinyi389 xuxinyi389 commented Oct 19, 2023

PR types

Others

PR changes

APIs

Description

Pcard-73263
diag_embed是一种使用频率较高的创建方法,需要支持Paddle/Tensor.diag_embed的调用形式。简单实现办法是在tensor_match_methods.py文件中import该函数将其作为Tensor类方法,但此时会遇到import循环依赖的问题(解决成本较高,也无必要)。目前与其属于同类的的diag、diagflat、diagonal API被放置在paddle/tensor/creation.py中。现在将diag_embed函数的实现迁移到同类API所在的creation.py文件中,而在原实现位置调用,并做废弃警告处理。

@paddle-bot
Copy link

paddle-bot bot commented Oct 19, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

zhwesky2010
zhwesky2010 previously approved these changes Oct 19, 2023
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@xuxinyi389 xuxinyi389 changed the title Remove diag embed to creation 【不兼容升级】移除paddle.nn.functional.diag_embed,添加paddle.diag_embed并支持作为类方法 Oct 20, 2023
@jeff41404
Copy link
Contributor

should delete diag_embed from __all__ list in python/paddle/nn/functional/__init__.py

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM,请同步提供中文文档

@zhwesky2010 zhwesky2010 merged commit 7d87b2d into PaddlePaddle:develop Oct 23, 2023
28 checks passed
hitywt pushed a commit to hitywt/Paddle that referenced this pull request Oct 24, 2023
…addlePaddle#58223)

* remove_diag_embed_to_creation

* remove_diag_embed_to_creation

* Update __init__.py

* Incompatible upgrade

* fix_bugs

* add_deprecated

* remove diag_embed from __all__
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Oct 26, 2023
…addlePaddle#58223)

* remove_diag_embed_to_creation

* remove_diag_embed_to_creation

* Update __init__.py

* Incompatible upgrade

* fix_bugs

* add_deprecated

* remove diag_embed from __all__
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
…addlePaddle#58223)

* remove_diag_embed_to_creation

* remove_diag_embed_to_creation

* Update __init__.py

* Incompatible upgrade

* fix_bugs

* add_deprecated

* remove diag_embed from __all__
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.

6 participants