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

support the bool tensor and scalar in elementwise ops #32272

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

wawltor
Copy link
Contributor

@wawltor wawltor commented Apr 14, 2021

PR types

Performance optimization

PR changes

APIs

Describe

support the bool tensor and scalar
之前的版本bool + float的输出一个bool的输出,修复之后即为float类型的输出

import paddle
a = 1.5
b = paddle.full([2, 2, 2], True, dtype='bool')
c = a + b
print(c)
#Tensor(shape=[2, 2, 2], dtype=float32, place=CUDAPlace(0), stop_gradient=True,
#       [[[2.50000000, 2.50000000],
#        [2.50000000, 2.50000000]],

#       [[2.50000000, 2.50000000],
#       [2.50000000, 2.50000000]]])

@paddle-bot-old
Copy link

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

Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor merged commit 7da4455 into PaddlePaddle:develop Apr 14, 2021
@wawltor wawltor changed the title support the bool tensor and scalar support the bool tensor and scalar in elementwise api Apr 14, 2021
@wawltor wawltor changed the title support the bool tensor and scalar in elementwise api support the bool tensor and scalar in elementwise ops Apr 14, 2021
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.

2 participants