Skip to content

Make release_resources non-const#10192

Closed
smessmer wants to merge 2 commits intopytorch:masterfrom
smessmer:export-D9143808
Closed

Make release_resources non-const#10192
smessmer wants to merge 2 commits intopytorch:masterfrom
smessmer:export-D9143808

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Aug 3, 2018

Summary:

  • release_resources() method must be non-const because it modifies the object
  • for intrusive_ptr, this needs to be const_cast :(

Differential Revision: D9143808

Summary: This is useful for C APIs where we want to give owning pointers to/from other languages.

Differential Revision: D9121493

fbshipit-source-id: 315fdd73264a6cb1486f6496efc38e5c02c5248f
Summary:
Pull Request resolved: pytorch#10192

- release_resources() method must be non-const because it modifies the object
- for intrusive_ptr<const MyClass>, this needs to be const_cast :(

Reviewed By: ezyang

Differential Revision: D9143808

fbshipit-source-id: fa3004472411b454b9298a304378b33ac7b7645a
zdevito pushed a commit to zdevito/ATen that referenced this pull request Aug 3, 2018
Summary:
Pull Request resolved: pytorch/pytorch#10192

- release_resources() method must be non-const because it modifies the object
- for intrusive_ptr<const MyClass>, this needs to be const_cast :(

Reviewed By: ezyang

Differential Revision: D9143808

fbshipit-source-id: 9203ff7a7ff3bec165931279371c6e75d4f0ca8c
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
Pull Request resolved: pytorch#10192

- release_resources() method must be non-const because it modifies the object
- for intrusive_ptr<const MyClass>, this needs to be const_cast :(

Reviewed By: ezyang

Differential Revision: D9143808

fbshipit-source-id: 9203ff7a7ff3bec165931279371c6e75d4f0ca8c
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants