-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add ext_tensor.slice() API #34227
Add ext_tensor.slice() API #34227
Conversation
Thanks for your contribution! |
framework::vectorize<int64_t>(tensor->dims()); | ||
shape_vec[0] = end_idx - begin_idx; | ||
Tensor target = Tensor(place_, shape_vec); | ||
auto *target_tensor = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to use CustomTensorUtils::ShareDataFrom
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
APIs
Describe
Add
Tensor slice(const int64_t begin_idx, const int64_t end_idx) const;
for ext_tensor, which introduces tensor slicing feature for custom external operators.A detailed doc PR in Chinese is now available at docs PR3824.