File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1010@torch .no_grad ()
1111def main () -> None :
1212 device = 'cuda:0' if torch .cuda .is_available () else 'cpu'
13+ from torchsparse .nn import functional as F
14+ F .set_kmap_mode ('hashmap' )
1315
1416 for backbone in [SparseResNet21D , SparseResUNet42 ]:
1517 print (f'{ backbone .__name__ } :' )
@@ -23,8 +25,8 @@ def main() -> None:
2325 pcs -= np .min (pcs , axis = 0 , keepdims = True )
2426 pcs , indices = sparse_quantize (pcs , voxel_size , return_index = True )
2527 coords = np .zeros ((pcs .shape [0 ], 4 ))
26- coords [:, : 3 ] = pcs [:, :3 ]
27- coords [:, - 1 ] = 0
28+ coords [:, 1 : 4 ] = pcs [:, :3 ]
29+ coords [:, 0 ] = 0
2830 coords = torch .as_tensor (coords , dtype = torch .int )
2931 feats = torch .as_tensor (feats [indices ], dtype = torch .float )
3032 input = SparseTensor (coords = coords , feats = feats ).to (device )
You can’t perform that action at this time.
0 commit comments