Skip to content

Conversation

@gchanan
Copy link
Contributor

@gchanan gchanan commented Aug 3, 2018

No description provided.

gchanan added 4 commits August 3, 2018 11:40
… 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.
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@gchanan
Copy link
Contributor Author

gchanan commented Aug 3, 2018

@gchanan
Copy link
Contributor Author

gchanan commented Aug 3, 2018

@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.

if(THTensor_getStoragePtr(self) != storage)
{
if (!THTensor_getStoragePtr(self)) {
THError("Tensor: invalid null storage");

This comment was marked as off-topic.

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
@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.

3 participants