[slimtensor] Add from_etensor factory function for ETensor to SlimTensor conversion#16996
Merged
[slimtensor] Add from_etensor factory function for ETensor to SlimTensor conversion#16996
Conversation
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/)
🔗 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 PendingAs of commit 0c2bf96 with merge base 944a436 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Gasoonjia
approved these changes
Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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