-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add cat_union #130
base: master
Are you sure you want to change the base?
Add cat_union #130
Conversation
Thanks for your contribution. However, this function requires creating two existing coords map A.C, B.C. |
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) |
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.
dtype specification required.
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.
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( |
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.
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
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