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

[Zero-Dim] support input 0D Tensor for maximum,minimum,allclose,sigmoid_focal_loss #49616

Merged
merged 4 commits into from
Jan 10, 2023

Conversation

FlyingQianMM
Copy link
Contributor

PR types

New features

PR changes

APIs

Describe

[Zero-Dim] support input 0D Tensor for some binary api.

paddle.maximum
paddle.minimum
paddle.allclose
paddle.nn.functional.sigmoid_focal_loss

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

@FlyingQianMM FlyingQianMM changed the title [Zero-Dim] support input 0D Tensor for maximum,minimum,allclose,sigmo… [Zero-Dim] support input 0D Tensor for maximum,minimum,allclose,sigmoid_focal_loss Jan 6, 2023
label = paddle.to_tensor(
[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]], dtype='float32'
)
one = paddle.to_tensor([1.0], dtype='float32')
Copy link
Contributor

Choose a reason for hiding this comment

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

这个可以删了吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除,感谢~

one = paddle.to_tensor([1.0], dtype='float32')
fg_num_0 = paddle.full([], 2.0)
fg_num_1 = paddle.full([1], 2.0)
np.testing.assert_array_equal(
Copy link
Contributor

Choose a reason for hiding this comment

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

需要测下反向

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已添加反向梯度测试,感谢~

zhwesky2010
zhwesky2010 previously approved these changes Jan 10, 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

jzhang533
jzhang533 previously approved these changes Jan 10, 2023
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

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

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.

None yet

3 participants