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

Method test

tests/python/chwise_conv.py:48–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46class TestConvolution(unittest.TestCase):
47
48 def test(self):
49 print(f"{self.__class__.__name__}: test")
50 in_channels, D = 3, 2
51 coords, feats, labels = data_loader(in_channels, batch_size=2)
52
53 # Create random coordinates with tensor stride == 2
54 out_coords, tensor_stride = get_random_coords()
55
56 feats = feats.double()
57 feats.requires_grad_()
58 input = SparseTensor(feats, coords=coords)
59
60 conv = MinkowskiChannelwiseConvolution(
61 in_channels,
62 kernel_size=3,
63 stride=1,
64 has_bias=False,
65 dimension=D).double()
66
67 print('Initial input: ', input)
68 output = conv(input)
69 print('Conv output: ', output)
70
71 output.F.sum().backward()
72 print(input.F.grad)
73
74 def test_gpu(self):
75 print(f"{self.__class__.__name__}: test_gpu")

Callers

nothing calls this directly

Calls 8

data_loaderFunction · 0.90
SparseTensorClass · 0.90
convFunction · 0.85
doubleMethod · 0.80
requires_grad_Method · 0.80
get_random_coordsFunction · 0.70
backwardMethod · 0.45

Tested by

no test coverage detected