Stop using THLongStorage for sizes/strides, remove THLongStorageView.#10219
Closed
gchanan wants to merge 4 commits intopytorch:masterfrom
Closed
Stop using THLongStorage for sizes/strides, remove THLongStorageView.#10219gchanan wants to merge 4 commits intopytorch:masterfrom
gchanan wants to merge 4 commits intopytorch:masterfrom
Conversation
… of functions in TH. This changes setStorage (called by set_), newView (view), and newWithStorage (tensor) as per the title. This also allows us to share size inference code between TH and ATen, so I killed e.g. newInferSize in TH; we just use at::infer_size inside of TH now. Finally, I reorganized the TH/THC tensor/storage code to more closely match up; e.g. if THC has a non-generic version of a function, TH will as well. NOTE: I didn't completely kill THSize, THStride yet because I haven't moved all the functions over yet. This has the unfortunate effect that we now have both IntList and Storage versions of the same concepts, e.g. there are IntListSize and IntListStride in Declarations.cwrap that pull out the LongStorage-ness, but not the 0-dim-to-1-dim or 0-dim-to-null functionality of THLongStorageView. Both of these limitations will be addressed in further PRs.
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
gchanan has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Contributor
Author
|
This is stacked on top of #10209, to review look at https://github.com/pytorch/pytorch/pull/10219/files/ad94ee36272b5f6a2d631974618a87f95afac159..HEAD. |
Contributor
Author
|
@pytorchbot retest this please. |
ezyang
reviewed
Aug 4, 2018
| static int64_t one = 1; | ||
| if (sizes.size() == 0) { | ||
| // fake scalar | ||
| return IntList(&one, 1); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
ezyang
reviewed
Aug 4, 2018
| if(THTensor_getStoragePtr(self) != storage) | ||
| { | ||
| if (!THTensor_getStoragePtr(self)) { | ||
| THError("Tensor: invalid null storage"); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
ezyang
approved these changes
Aug 6, 2018
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Aug 6, 2018
Summary: Pull Request resolved: pytorch/pytorch#10219 Reviewed By: cpuhrsch Differential Revision: D9159550 Pulled By: gchanan fbshipit-source-id: 745a6d335613688ed41b32369ee4938907ce8cbb
goodlux
pushed a commit
to goodlux/pytorch
that referenced
this pull request
Aug 15, 2018
Summary: Pull Request resolved: pytorch#10219 Reviewed By: cpuhrsch Differential Revision: D9159550 Pulled By: gchanan fbshipit-source-id: 745a6d335613688ed41b32369ee4938907ce8cbb
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.
No description provided.