(self)
| 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") |
nothing calls this directly
no test coverage detected