MCPcopy Create free account
hub / github.com/NVIDIA/MinkowskiEngine / test_empty

Method test_empty

tests/python/pruning.py:82–109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

80 print(output)
81
82 def test_empty(self):
83 in_channels = 2
84 coords, feats, labels = data_loader(in_channels, batch_size=1)
85 feats = feats.double()
86 feats.requires_grad_()
87 input = SparseTensor(feats, coords)
88 use_feat = torch.BoolTensor(len(input))
89 use_feat.zero_()
90 pruning = MinkowskiPruning()
91 output = pruning(input, use_feat)
92 print(input)
93 print(use_feat)
94 print(output)
95
96 # Check backward
97 fn = MinkowskiPruningFunction()
98 self.assertTrue(
99 gradcheck(
100 fn,
101 (
102 input.F,
103 use_feat,
104 input.coordinate_map_key,
105 output.coordinate_map_key,
106 input.coordinate_manager,
107 ),
108 )
109 )
110
111 def test_pruning(self):
112 in_channels, D = 2, 2

Callers

nothing calls this directly

Calls 7

data_loaderFunction · 0.90
SparseTensorClass · 0.90
MinkowskiPruningClass · 0.90
gradcheckFunction · 0.90
doubleMethod · 0.80
requires_grad_Method · 0.80

Tested by

no test coverage detected