Skip to content

Conversation

@Stonepia
Copy link
Contributor

@Stonepia Stonepia commented Jan 7, 2026

Fixes pytorch/pytorch#164872
This PR adds the implement_torch_function for __getitem__, so when slicing, it won't trigger the "Cannot set version_counter for inference tensor"

cc: @jerryzh168 @bdhirsh

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 7, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3590

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 7, 2026
@Stonepia
Copy link
Contributor Author

Stonepia commented Jan 7, 2026

Honestly, I am not very sure this change is ok. Seems that I am pushing too many code into the fp8 support, but these code are not elegant at all and seems more like a workaround...

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 Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tensor subclass slice during inference_mode fails

1 participant