Skip to content
New issue

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

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

Already on GitHub? # to your account

[Dy2St] transforms.RandomErasing Support static mode #49617

Merged
merged 4 commits into from
Jan 9, 2023
Merged

[Dy2St] transforms.RandomErasing Support static mode #49617

merged 4 commits into from
Jan 9, 2023

Conversation

DrRyanHuang
Copy link
Member

PR types

New features

PR changes

OPs

Describe

@paddle-bot
Copy link

paddle-bot bot commented Jan 6, 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.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Jan 6, 2023
Comment on lines +1917 to +1931
top = paddle.static.nn.cond(
erase_h < h and erase_w < w,
lambda: paddle.uniform(
shape=[1], min=0, max=h - erase_h + 1
).astype("int32"),
lambda: zero,
)

left = paddle.static.nn.cond(
erase_h < h and erase_w < w,
lambda: paddle.uniform(
shape=[1], min=0, max=w - erase_w + 1
).astype("int32"),
lambda: zero,
)
Copy link
Member Author

@DrRyanHuang DrRyanHuang Jan 7, 2023

Choose a reason for hiding this comment

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

这两行不用 randint 而使用 uniform ,是因为 randinthigh low 参数似乎不支持静态图 Variable

这是 issue 地址: #49620

Aurelius84
Aurelius84 previously approved these changes Jan 9, 2023
Copy link
Contributor

@Aurelius84 Aurelius84 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

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

LGTM

@Aurelius84 Aurelius84 merged commit e9df6fc into PaddlePaddle:develop Jan 9, 2023
@DrRyanHuang DrRyanHuang deleted the RandomErasing branch January 9, 2023 09:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants