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

Method test_analytic

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

Source from the content-addressed store, hash-verified

400 )
401
402 def test_analytic(self):
403 print(f"{self.__class__.__name__}: test")
404 in_channels, out_channels, D = 2, 2, 2
405 coords = torch.IntTensor([[0, 0, 0], [0, 1, 1], [0, 2, 1]])
406 feats = torch.FloatTensor([[0, 1], [1, 0], [1, 1]])
407 input = SparseTensor(feats, coordinates=coords)
408 # Initialize context
409 conv = MinkowskiConvolution(
410 in_channels, out_channels, kernel_size=2, stride=2, bias=False, dimension=D
411 )
412 conv.kernel[:] = torch.FloatTensor(
413 [[[1, 2], [2, 1]], [[0, 1], [1, 0]], [[0, 1], [1, 1]], [[1, 1], [1, 0]]]
414 )
415 output = conv(input)
416 print(output)
417
418 conv_tr = MinkowskiConvolutionTranspose(
419 in_channels, out_channels, kernel_size=2, stride=2, bias=False, dimension=D
420 )
421 conv_tr.kernel[:] = torch.FloatTensor(
422 [[[1, 2], [2, 1]], [[0, 1], [1, 0]], [[0, 1], [1, 1]], [[1, 1], [1, 0]]]
423 )
424 output_tr = conv_tr(output)
425 print(output_tr)
426
427 def test_analytic_odd(self):
428 print(f"{self.__class__.__name__}: test")

Callers

nothing calls this directly

Calls 4

SparseTensorClass · 0.90
convFunction · 0.85

Tested by

no test coverage detected