Fix various sparse transpose issues; remove dead code from Declaratio…#7200
Merged
gchanan merged 7 commits intopytorch:masterfrom May 18, 2018
Merged
Fix various sparse transpose issues; remove dead code from Declaratio…#7200gchanan merged 7 commits intopytorch:masterfrom
gchanan merged 7 commits intopytorch:masterfrom
Conversation
…ns.yaml. 1) Fixes some checks in t_, transpose_ that don't allow transposing empty sparse tensors. 2) Remove out= variants from docs since they don't exist (and haven't since at least v0.3.1). 3) Unify implementations of t_, transpose_, t, transpose. 4) Move dead checking code from Declarations.cwrap to actual implementations. 5) Fix test which never tested transpose_.
Contributor
Author
zou3519
reviewed
May 3, 2018
| row0.copy_(row1); | ||
| row1.copy_(tmp); | ||
| return self.sparse_raw_resize_(sizes, self._dimI(), self._dimV()); | ||
| } else { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
reviewed
May 3, 2018
aten/src/ATen/native/TensorShape.cpp
Outdated
| int64_t nDimI = self._dimI(); | ||
| int64_t nDimV = self._dimV(); | ||
| if (!(nDimI == 2 && nDimV == 0)) { | ||
| AT_ERROR(fn, " expects a 2D sparse tensor, but self is ", nDimI, "D indices and ", nDimV, "D values"); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
reviewed
May 3, 2018
aten/src/ATen/native/TensorShape.cpp
Outdated
| if (!(nDimI == 2 && nDimV == 0)) { | ||
| AT_ERROR(fn, " expects a 2D sparse tensor, but self is ", nDimI, "D indices and ", nDimV, "D values"); | ||
| } | ||
| } else if (self.ndimension() != 2) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
reviewed
May 3, 2018
aten/src/ATen/native/TensorShape.cpp
Outdated
| AT_ERROR(fn, " expects a 2D sparse tensor, but self is ", nDimI, "D indices and ", nDimV, "D values"); | ||
| } | ||
| } else if (self.ndimension() != 2) { | ||
| AT_ERROR(fn, " expects a 2D tensor, but self is ", self.ndimension()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
reviewed
May 3, 2018
| x.t_() | ||
| self.assertEqual(torch.Size([3, 2]), x.size()) | ||
| self.assertEqual(0, x._indices().numel()) | ||
| self.assertEqual(0, x._values().numel()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
approved these changes
May 3, 2018
Contributor
zou3519
left a comment
There was a problem hiding this comment.
lgtm as long as tests pass!
ezyang
approved these changes
May 13, 2018
Contributor
|
onnxbot
added a commit
to onnxbot/onnx-fb-universe
that referenced
this pull request
May 18, 2018
…s; remove dead code from Declaratio… (pytorch/pytorch#7200) pytorch/pytorch@4f20a0e
weiyangfb
pushed a commit
to weiyangfb/pytorch
that referenced
this pull request
Jun 11, 2018
pytorch#7200) * Fix various sparse transpose issues; remove dead code from Declarations.yaml. 1) Fixes some checks in t_, transpose_ that don't allow transposing empty sparse tensors. 2) Remove out= variants from docs since they don't exist (and haven't since at least v0.3.1). 3) Unify implementations of t_, transpose_, t, transpose. 4) Move dead checking code from Declarations.cwrap to actual implementations. 5) Fix test which never tested transpose_. * Add test for error with t, t_. * Address review comments. * Fix jit tests. * Fix test_jit.
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.
…ns.yaml.