Skip to content
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

Remove reference_cast in make_boxed_from_unboxed_functor (pytorch/pytorch#51319) #1300

Merged
merged 1 commit into from Feb 23, 2021

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Feb 23, 2021

This PR cherry-picks a044625 on top of master, by taking into account the changes from #1285

Summary:
Pull Request resolved: pytorch/pytorch#51319

We were going out of our way to accommodate IValue::to<Tensor> returning a copy of the inner Tensor. IValue::toTensor is capable of returning a reference without copying, so if we use it directly, we can allow kernels that want to take Tensor & to do so!
As a bonus, we get reduced build times.
ghstack-source-id: 121378961

Reviewed By: bhosmer

Differential Revision: D26138549

fbshipit-source-id: b0f830527da360c542c815bef2f7e1692615b32a

Summary:
Pull Request resolved: pytorch/pytorch#51319

We were going out of our way to accommodate `IValue::to<Tensor>` returning a copy of the inner Tensor. `IValue::toTensor` is capable of returning a reference without copying, so if we use it directly, we can allow kernels that want to take `Tensor &` to do so!
As a bonus, we get reduced build times.
ghstack-source-id: 121378961

Reviewed By: bhosmer

Differential Revision: D26138549

fbshipit-source-id: b0f830527da360c542c815bef2f7e1692615b32a
@mthrok mthrok changed the title Remove reference_cast in make_boxed_from_unboxed_functor (#51319) Remove reference_cast in make_boxed_from_unboxed_functor (pytorch/pytorch#51319) Feb 23, 2021
Copy link
Collaborator

@mthrok mthrok left a comment

Choose a reason for hiding this comment

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

Thank you!

@mthrok mthrok merged commit e1bea2b into pytorch:master Feb 23, 2021
@fmassa fmassa deleted the import_D26138549 branch February 23, 2021 15:05
mthrok pushed a commit to mthrok/audio that referenced this pull request Dec 13, 2022
Fix lengths to cpu. See issue pytorch#1300

Co-authored-by: Brian Johnson <brianjo@fb.com>
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.

None yet

4 participants