Remove setting coalesce to 0 in sparse transpose_#4707
Merged
ezyang merged 3 commits intopytorch:masterfrom Jan 24, 2018
Merged
Remove setting coalesce to 0 in sparse transpose_#4707ezyang merged 3 commits intopytorch:masterfrom
ezyang merged 3 commits intopytorch:masterfrom
Conversation
Contributor
|
Nice catch! |
Collaborator
|
should you also change THCSTensor ? |
Contributor
|
@pytorchbot retest this please |
Member
|
Can you add a unit test for this behavior? |
Contributor
|
@pytorchbot retest this please |
1 similar comment
Contributor
|
@pytorchbot retest this please |
|
This is incorrect. |
facebook-github-bot
pushed a commit
that referenced
this pull request
Aug 15, 2018
…iants (#10496) Summary: - fixes #6219 - removed invariants at #4707 - assume a sparse tensor with coalesced=true when: 1. its elements are unique and 2. the indices are in sorted order Pull Request resolved: #10496 Differential Revision: D9311214 Pulled By: weiyangfb fbshipit-source-id: 167fa5a8e9e5f9c800db02f728a1194029f7e4f3
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Aug 15, 2018
…iants (#10496) Summary: - fixes pytorch/pytorch#6219 - removed invariants at pytorch/pytorch#4707 - assume a sparse tensor with coalesced=true when: 1. its elements are unique and 2. the indices are in sorted order Pull Request resolved: pytorch/pytorch#10496 Differential Revision: D9311214 Pulled By: weiyangfb fbshipit-source-id: 167fa5a8e9e5f9c800db02f728a1194029f7e4f3
goodlux
pushed a commit
to goodlux/pytorch
that referenced
this pull request
Aug 15, 2018
…iants (pytorch#10496) Summary: - fixes pytorch#6219 - removed invariants at pytorch#4707 - assume a sparse tensor with coalesced=true when: 1. its elements are unique and 2. the indices are in sorted order Pull Request resolved: pytorch#10496 Differential Revision: D9311214 Pulled By: weiyangfb fbshipit-source-id: 167fa5a8e9e5f9c800db02f728a1194029f7e4f3
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.
coalescedmeans that the sparse tensor'sindicesare all unique.Let's say we transpose a sparse tensor in dimensions
d0, d1. Let's say each index is somex_i = (y_1, y_2, ..., y_n)wherenis the total number of dimensions of the sparse tensor. Transposing the sparse tensor in place is equivalent to swappingy_{d0}, y_{d1}for all indicesx_i.If all the indices were unique before, then they will be unique after. If they were non-unique before, they will be non-unique after.
This change removes setting
coalescedto 0 after every transpose. In practice it doesn't affect very much but it's good for correctness.Test Plan
run tests