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