-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Stop using THLongStorage for sizes/strides, remove THLongStorageView. #10219
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
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.
facebook-github-bot
left a comment
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.
gchanan has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This is stacked on top of #10209, to review look at https://github.com/pytorch/pytorch/pull/10219/files/ad94ee36272b5f6a2d631974618a87f95afac159..HEAD. |
|
@pytorchbot retest this please. |
| 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.
| 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.
Summary: Pull Request resolved: pytorch/pytorch#10219 Reviewed By: cpuhrsch Differential Revision: D9159550 Pulled By: gchanan fbshipit-source-id: 745a6d335613688ed41b32369ee4938907ce8cbb
Summary: Pull Request resolved: pytorch#10219 Reviewed By: cpuhrsch Differential Revision: D9159550 Pulled By: gchanan fbshipit-source-id: 745a6d335613688ed41b32369ee4938907ce8cbb
No description provided.