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

Method test_analytic

tests/python/convolution.py:226–245  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

224 print(i)
225
226 def test_analytic(self):
227 print(f"{self.__class__.__name__}: test")
228 in_channels, out_channels, D = 2, 2, 1
229 coords = torch.IntTensor([[0, 0], [0, 1], [0, 2]])
230 feats = torch.FloatTensor([[0, 1], [1, 0], [1, 1]])
231 input = SparseTensor(feats, coordinates=coords)
232 # Initialize context
233 conv = MinkowskiConvolution(
234 in_channels, out_channels, kernel_size=2, stride=2, bias=False, dimension=D
235 )
236 conv.kernel[:] = torch.FloatTensor([[[1, 2], [2, 1]], [[0, 1], [1, 0]]])
237 output = conv(input)
238 print(output)
239
240 conv = MinkowskiConvolution(
241 in_channels, out_channels, kernel_size=2, stride=1, bias=False, dimension=D
242 )
243 conv.kernel[:] = torch.FloatTensor([[[1, 2], [2, 1]], [[0, 1], [1, 0]]])
244 output = conv(input)
245 print(output)
246
247
248class TestConvolutionMode(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

SparseTensorClass · 0.90
convFunction · 0.85

Tested by

no test coverage detected