Skip to content

Fix negative indexing and multi-dimensional slicing in Helion #438

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

Open
wants to merge 1 commit into
base: yf225/stack/53
Choose a base branch
from

Conversation

yf225
Copy link
Contributor

@yf225 yf225 commented Aug 6, 2025

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 6, 2025
@yf225 yf225 changed the base branch from yf225/stack/53 to main August 6, 2025 06:42
@yf225 yf225 changed the base branch from main to yf225/stack/53 August 6, 2025 06:42
Comment on lines +884 to +886
if k < 0:
dim_idx = len(res.offsets)
res.offsets.append(
_normalize_negative_index(k, dim_idx, fake_value, state)
)
else:
res.offsets.append(repr(k))
Copy link
Contributor

Choose a reason for hiding this comment

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

Move the conditional into the helper to reduce duplicate code.

@yf225 yf225 changed the base branch from yf225/stack/53 to main August 6, 2025 17:35
@yf225 yf225 changed the base branch from main to yf225/stack/53 August 6, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants