File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
pytorch_sparse_utils/batching Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,7 @@ source = ["pytorch_sparse_utils"]
4747parallel = true
4848
4949[tool .coverage .report ]
50- exclude_lines = [
51- " pragma: no cover" ,
50+ exclude_also = [
5251 " def __repr__" ,
5352 " raise AssertionError" ,
5453 " raise NotImplementedError" ,
Original file line number Diff line number Diff line change 55from torch import Tensor
66
77
8- def concatted_to_nested_tensor (tensor : Tensor , batch_offsets : Tensor ) -> Tensor :
8+ def concatted_to_nested_tensor (
9+ tensor : Tensor , batch_offsets : Tensor
10+ ) -> Tensor : # pragma: no cover
911 assert batch_offsets .ndim == 1
1012 split_tensor = split_batch_concatenated_tensor (tensor , batch_offsets )
1113 return torch .nested .as_nested_tensor (list (* split_tensor ))
1214
1315
14- def flatten_multi_level_sparse_maps_to_nested (tensors : list [Tensor ]):
16+ def flatten_multi_level_sparse_maps_to_nested (
17+ tensors : list [Tensor ],
18+ ): # pragma: no cover
1519 # tensors is a list of pytorch sparse tensors of dimension batch x height x width x channel
1620 assert all (isinstance (tensor , Tensor ) for tensor in tensors )
1721 assert all (tensor .is_sparse for tensor in tensors )
@@ -65,7 +69,7 @@ def nested_flattened_tensors_to_sparse_tensors(
6569 levels : Tensor ,
6670 indices : Tensor ,
6771 level_spatial_shapes : list [list [int ]],
68- ):
72+ ): # pragma: no cover
6973 all_levels = torch .unique (torch .cat ([torch .unique (lev ) for lev in levels ]))
7074 batch_size = features .size (0 )
7175 assert levels .size (0 ) == indices .size (0 ) == batch_size
You can’t perform that action at this time.
0 commit comments