-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Remove manual refcounting from Tensor class #11294
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
Closed
Closed
Conversation
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
Differential Revision: D9663476 Differential Version: 56982467
ezyang
reviewed
Sep 5, 2018
aten/src/ATen/function_wrapper.py
Outdated
| wrapped_tensor = CodeTemplate(ALLOC_WRAP[ret['type']]).substitute( | ||
| env, arguments=[call]) | ||
| return_tensor = "return Tensor((${wrapped_tensor})${maybe_scalar},false);" | ||
| return_tensor = "return Tensor(c10::intrusive_ptr<TensorImpl, UndefinedTensor>::reclaim((${wrapped_tensor})${maybe_scalar}));" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
ezyang
approved these changes
Sep 5, 2018
Differential Revision: D9663476 Differential Version: 57101556
Differential Revision: D9663476 Differential Version: 57135226
Differential Revision: D9663476 Differential Version: 57214029
This was referenced Sep 7, 2018
Closed
Closed
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Sep 10, 2018
Summary: Pull Request resolved: pytorch/pytorch#11294 The Tensor(ptr, retain) constructor is error prone and circumvents the intrusive_ptr safety. This diff removes that and pushes the responsibility to callers. Step by step, manual refcounting can be pushed back and possibly eliminated in the end. Reviewed By: ezyang Differential Revision: D9663476 fbshipit-source-id: 7f010e5e47b137a9575960201c5bf5d552c5c2f5
PenghuiCheng
pushed a commit
to PenghuiCheng/pytorch
that referenced
this pull request
Sep 11, 2018
Summary: Pull Request resolved: pytorch#11294 The Tensor(ptr, retain) constructor is error prone and circumvents the intrusive_ptr safety. This diff removes that and pushes the responsibility to callers. Step by step, manual refcounting can be pushed back and possibly eliminated in the end. Reviewed By: ezyang Differential Revision: D9663476 fbshipit-source-id: 7f010e5e47b137a9575960201c5bf5d552c5c2f5
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.
Stack:
:white_circle: #11167 Narrowing Blob 💛
:white_circle: #11238 Some improvements to IValue 💛
:white_circle: #11258 Improve Tensor() constructor 💛
:white_circle: #11260 Fix intrusive_ptr move/copy for different NullType's 💛
:black_circle: #11294 Remove manual refcounting from Tensor class 💛
:white_circle: #11352 Remove intrusive_ptr::reclaim() in Storage 💛
:white_circle: #11353 Simplify union payload copying 💛
:white_circle: #11355 Simplify IValue::toTensor() 💛
:white_circle: #11402 Simplify Blob move constructor/assignment 💛
:white_circle: #11414 IValue can store Blob 💛
:white_circle: #11481 Blob doesn't allow access to destroyCall anymore 💛
The Tensor(ptr, retain) constructor is error prone and circumvents the intrusive_ptr safety.
This diff removes that and pushes the responsibility to callers.
Step by step, manual refcounting can be pushed back and possibly eliminated in the end.
Differential Revision: D9663476