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

API improvement for nn.functional.upsample #61974

Merged
merged 9 commits into from
Feb 27, 2024

Conversation

NKNaN
Copy link
Contributor

@NKNaN NKNaN commented Feb 22, 2024

PR types

Others

PR changes

APIs

Description

continue the work of: #56471

Copy link

paddle-bot bot commented Feb 22, 2024

你的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.

@paddle-bot paddle-bot bot added the contributor External developers label Feb 22, 2024
@@ -906,6 +906,13 @@ def upsample(
[2, 3, 12, 12]

"""
if data_format == 'NCHW':
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. data_format默认值可以为None,在None的情况下,1D默认NCW,2D默认NCHW,3D默认NCDHW。
  2. 直接在interpolate里修改吧,在最底层改,上层的API都会支持
  3. 这些逻辑要在API文档里写清楚,包括所有涉及到的API:interpolate、upsampe、Upsample等,参数里对x的描述、对data_format的描述都需要写清楚新的逻辑

后续的API改动注意更新英文API文档,合入后记得更新doc里的中文API文档

zhwesky2010
zhwesky2010 previously approved these changes Feb 26, 2024
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

the output will be consistent with that of the input. An optional string from:`"NCW"`,
`"NWC"`, `"NCHW"`, `"NHWC"`, `"NCDHW"`, `"NDHWC"`. The default value is None.
When :attr:`data_format` is not specified, it will be automatically inferred from the
input shape of :attr:`x`. When :attr:`x` is a 3-D Tensor, :attr:`data_format` will be
Copy link
Contributor

Choose a reason for hiding this comment

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

input dimension

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

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 , 记得中文文档同步更新~

@luotao1 luotao1 merged commit 269de7f into PaddlePaddle:develop Feb 27, 2024
30 checks passed
@NKNaN NKNaN deleted the api/upsample branch March 20, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants