Skip to content

Improving tv_tensors wrap API for extensibility. - #9398

Closed
gabrielfruet wants to merge 16 commits into
pytorch:mainfrom
gabrielfruet:feat/extend-wrap
Closed

gabrielfruet wants to merge 16 commits into
pytorch:mainfrom
gabrielfruet:feat/extend-wrap

Conversation

@gabrielfruet

@gabrielfruet gabrielfruet commented Feb 20, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #9333

Adopt a method-based wrapping, enabling user to extend functionality on subclasses of TVTensor.

This is the pythonic approach, since we have many built-ins that rely on this on pattern (e.g len, iter, next ...)

This does not break backwards compatibility.

@pytorch-bot

pytorch-bot Bot commented Feb 20, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9398

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 label Feb 20, 2026
@gabrielfruet gabrielfruet changed the title Improving tv_tensors wrap API for extensability. Improving tv_tensors wrap API for extensibility. Feb 22, 2026

@zy1git zy1git left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gabrielfruet Thanks a lot for the PR. I left two comments.

it seems that there are some test failures which need to be addressed. If you are still working on this PR, feel free to convert it to a draft. When the PR is ready to be reviewed, just convert it back.

Comment thread torchvision/tv_tensors/__init__.py Resolved
@gabrielfruet
gabrielfruet marked this pull request as draft February 25, 2026 11:27
@gabrielfruet
gabrielfruet marked this pull request as ready for review March 31, 2026 22:36
@gabrielfruet
gabrielfruet requested a review from zy1git March 31, 2026 22:36
@gabrielfruet

Copy link
Copy Markdown
Contributor Author

@zy1git I think the PR is done. CI is red, but the errors are not related to my changes to my understanding.

@zy1git zy1git left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gabrielfruet Thanks a lot for this PR! I reviewed and left some comments. Feel free to take a look and address them.

Comment thread torchvision/tv_tensors/__init__.py Resolved
Comment thread torchvision/tv_tensors/__init__.py Resolved
Comment thread torchvision/tv_tensors/_keypoints.py Resolved
@gabrielfruet

Copy link
Copy Markdown
Contributor Author

@zy1git Thanks for the comments. I was able to fix all.

@gabrielfruet

Copy link
Copy Markdown
Contributor Author

@zy1git Hi, do you think we need any modification here or we can merge?

@zy1git

zy1git commented May 5, 2026

Copy link
Copy Markdown
Contributor

@gabrielfruet Thanks a lot for addressing the comments!

@NicolasHug Could you please take a look at this PR for a final pass?

@NicolasHug

Copy link
Copy Markdown
Member

@gabrielfruet thanks a lot for the PR and sorry for the churn on the review cycles. Since I'm low on time and review availability, I decided to implement this in a slightly different way through #9490.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants