(self)
| 78 | self.assertTrue(sum(len(in_map[0]) for k, in_map in kernel_maps.items()) == 16) |
| 79 | |
| 80 | def test_kernelmap(self): |
| 81 | print(f"{self.__class__.__name__}: test_kernelmap") |
| 82 | in_channels, out_channels, D = 2, 3, 2 |
| 83 | coords, feats, labels = data_loader(in_channels) |
| 84 | feats = feats.double() |
| 85 | feats.requires_grad_() |
| 86 | input = SparseTensor(feats, coordinates=coords) |
| 87 | |
| 88 | # Initialize context |
| 89 | conv = MinkowskiConvolution( |
| 90 | in_channels, |
| 91 | out_channels, |
| 92 | kernel_size=3, |
| 93 | stride=2, |
| 94 | bias=True, |
| 95 | dimension=D, |
| 96 | ).double() |
| 97 | output = conv(input) |
| 98 | |
| 99 | iC = input.C.numpy() |
| 100 | oC = output.C.numpy() |
| 101 | print(iC) |
| 102 | print(oC) |
| 103 | kernel_maps = output.coordinate_manager.kernel_map( |
| 104 | 1, 2, stride=2, kernel_size=3 |
| 105 | ) |
| 106 | for kernel_index, in_out_map in kernel_maps.items(): |
| 107 | for i, o in zip(in_out_map[0], in_out_map[1]): |
| 108 | print(kernel_index, iC[i], "->", oC[o]) |
| 109 | self.assertTrue(sum(len(in_map[0]) for k, in_map in kernel_maps.items()) == 16) |
nothing calls this directly
no test coverage detected