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

Method test

tests/cpp/convolution_cpu_test.py:13–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11
12class ConvolutionTestCase(unittest.TestCase):
13 def test(self):
14 IC, OC = 3, 5
15 coordinates = torch.IntTensor([[0, 1, -1], [0, 2, 1]])
16 in_features = torch.rand(len(coordinates), IC)
17
18 manager = _C.CoordinateMapManager()
19 in_key, unique_inverse_map = manager.insert_and_map(coordinates, [1, 1], "")
20 kernel_size = [3, 3]
21 kernel_stride = [2, 2]
22 kernel_dilation = [1, 1]
23 out_key = _C.CoordinateMapKey(3)
24
25 # size, in, out
26 kernel = torch.rand(9, IC, OC)
27
28 out_features = _C.ConvolutionForwardCPU(
29 in_features,
30 kernel,
31 kernel_size,
32 kernel_stride,
33 kernel_dilation,
34 _C.RegionType.HYPER_CUBE,
35 torch.IntTensor(),
36 in_key,
37 out_key,
38 manager,
39 )
40
41 print(in_features, out_features)
42
43 def test_backward(self):
44 IC, OC = 3, 5

Callers

nothing calls this directly

Calls 3

CoordinateMapManagerMethod · 0.80
CoordinateMapKeyMethod · 0.80
insert_and_mapMethod · 0.45

Tested by

no test coverage detected