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

Fix bug of slicing by none index #37400

Merged
merged 1 commit into from
Nov 22, 2021
Merged

Conversation

zyfncg
Copy link
Contributor

@zyfncg zyfncg commented Nov 21, 2021

PR types

Bug fixes

PR changes

APIs

Describe

Fix a bug of slicing by none index

Example:

Before this PR:

px = paddle.zeros([2, 4])
print(x[..., None, :, None].shape)
# [2, 1, 1, 4]
# expect result : [2, 1, 4, 1]

Now:

px = paddle.zeros([2, 4])
print(x[..., None, :, None].shape)
# [2, 1, 4, 1]
# expect result : [2, 1, 4, 1]

Copy link
Contributor

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

@MingMingShangTian MingMingShangTian left a comment

Choose a reason for hiding this comment

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

LGTM

@zyfncg zyfncg merged commit de0cb38 into PaddlePaddle:develop Nov 22, 2021
@zyfncg zyfncg deleted the slice_fix branch November 22, 2021 08:58
zyfncg added a commit to zyfncg/Paddle that referenced this pull request Dec 29, 2021
lanxianghit pushed a commit that referenced this pull request Dec 30, 2021
本PR修复了以下两个tensor切片索引bug:

1.修复Tensor索引赋值调用set_value op出现的显存泄露问题,该问题主要是由Inplace策略的使用不当导致,本PR中已完成修复。

2.修复使用多个None类型索引时结果维度异常的问题
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.

4 participants