Open
Conversation
Contributor
|
Thanks for your contribution. However, this function requires creating two existing coords map A.C, B.C. |
chrischoy
suggested changes
Apr 30, 2020
| assert cm == B.coords_man, "different coords_man" | ||
| assert A.tensor_stride == B.tensor_stride, "different tensor_stride" | ||
|
|
||
| zeros_cat_with_A = torch.zeros([A.F.shape[0], B.F.shape[1]]).to(A.device) |
Contributor
There was a problem hiding this comment.
dtype specification required.
Contributor
There was a problem hiding this comment.
zeros(shape, dtype=A.device)
| feats_A = torch.cat([A.F, zeros_cat_with_A], dim=1) | ||
| feats_B = torch.cat([zeros_cat_with_B, B.F], dim=1) | ||
|
|
||
| new_A = SparseTensor( |
Contributor
There was a problem hiding this comment.
Unnecessary coordinate creation. This essentially force create the same existing coords hash map.
Try using get_union_map. https://github.com/StanfordVL/MinkowskiEngine/blob/ded4c0c42ae50482f44f909a37fef16af16c36ec/MinkowskiEngine/MinkowskiCoords.py#L314
5f36307 to
7d84727
Compare
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.
Hello,
I made a simple function to concatenate the tensors which have different sparsity.
This can be used in UNet based auto-encoder, where generated tensors and skipped tensors have different sparsity.
Thanks