(self)
| 72 | print(input.F.grad) |
| 73 | |
| 74 | def test_gpu(self): |
| 75 | print(f"{self.__class__.__name__}: test_gpu") |
| 76 | if not torch.cuda.is_available(): |
| 77 | return |
| 78 | |
| 79 | device = torch.device('cuda') |
| 80 | in_channels, D = 3, 2 |
| 81 | coords, feats, labels = data_loader(in_channels, batch_size=2) |
| 82 | |
| 83 | # Create random coordinates with tensor stride == 2 |
| 84 | out_coords, tensor_stride = get_random_coords() |
| 85 | |
| 86 | feats = feats.double() |
| 87 | feats.requires_grad_() |
| 88 | input = SparseTensor(feats, coords=coords).to(device) |
| 89 | conv = MinkowskiChannelwiseConvolution( |
| 90 | in_channels, |
| 91 | kernel_size=3, |
| 92 | stride=1, |
| 93 | has_bias=False, |
| 94 | dimension=D).double().to(device) |
| 95 | |
| 96 | print('Initial input: ', input) |
| 97 | output = conv(input) |
| 98 | print('Conv output: ', output) |
| 99 | |
| 100 | |
| 101 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected