Skip to content

[slimtensor] Add from_etensor factory function for ETensor to SlimTensor conversion#16996

Merged
Gasoonjia merged 2 commits intomainfrom
gh/gasoonjia/100/orig
Jan 29, 2026
Merged

[slimtensor] Add from_etensor factory function for ETensor to SlimTensor conversion#16996
Gasoonjia merged 2 commits intomainfrom
gh/gasoonjia/100/orig

Conversation

@pytorchbot
Copy link
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #16551 by @Gasoonjia
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/gasoonjia/100/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/gasoonjia/100/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/gasoonjia/99/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/gasoonjia/100/orig
Differential Revision: D90539554
@diff-train-skip-merge

Pull Request resolved: #16469

This diff updates the slimtensor file names to follow ET style (use under_score instead of Camel).
Note that we keep the c10 files as Camel since et/c10 files are also in Camel Case.
ghstack-source-id: 336658382
@exported-using-ghexport

Differential Revision: [D90143740](https://our.internmc.facebook.com/intern/diff/D90143740/)
…sor conversion

Pull Request resolved: #16551

Add from_etensor() factory function that creates a SlimTensor from an ExecuTorch portable tensor (ETensor), copying data to a target device.

Key features:
- Handles int32_t to int64_t conversion for sizes/strides (ETensor uses int32_t, SlimTensor uses int64_t)
- Supports CPU and CUDA target devices via storage()->copy_()
- Preserves tensor strides (non-contiguous layouts)
- Provides both reference and pointer overloads
ghstack-source-id: 336658383
@exported-using-ghexport

Differential Revision: [D90539554](https://our.internmc.facebook.com/intern/diff/D90539554/)
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 29, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16996

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

⏳ No Failures, 142 Pending

As of commit 0c2bf96 with merge base 944a436 (image):
💚 Looks good so far! There are no failures yet. 💚

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 29, 2026
Base automatically changed from gh/gasoonjia/99/orig to main January 29, 2026 08:26
@Gasoonjia Gasoonjia merged commit a093fe4 into main Jan 29, 2026
156 of 158 checks passed
@Gasoonjia Gasoonjia deleted the gh/gasoonjia/100/orig branch January 29, 2026 08:27
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.

2 participants