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

[dynamic setitem] Fix bug of dynamic setitem: Decerease axes to do right broadcast #31960

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

liym27
Copy link
Contributor

@liym27 liym27 commented Mar 30, 2021

PR types

Bug fixes

PR changes

OPs

Describe

Fix bug of setitem when assign a tensor to a tensor.

For example:

x = paddle.ones(shape=[3, 4], dtype="int32")
x[:, 1] = x[:,1] * 2

print(x)

Before this PR,

Tensor(shape=[3, 4], dtype=int32, place=CPUPlace, stop_gradient=True,
       [[1, 2, 1, 1],
        [1, 4, 1, 1],
        [1, 4, 1, 1]])

After this PR,

Tensor(shape=[3, 4], dtype=int32, place=CPUPlace, stop_gradient=True,
       [[1, 2, 1, 1],
        [1, 2, 1, 1],
        [1, 2, 1, 1]])

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

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@liym27 liym27 merged commit 57d4288 into PaddlePaddle:develop Mar 30, 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