(self)
| 97 | layer(sinput) |
| 98 | |
| 99 | def test_baseline(self): |
| 100 | coords, colors, pcd = load_file("1.ply") |
| 101 | device = "cuda" |
| 102 | |
| 103 | D = 3 |
| 104 | batch_size = 16 |
| 105 | voxel_size = 0.02 |
| 106 | channels = [3, 64, 128] |
| 107 | dcoords = torch.from_numpy(np.floor(coords / voxel_size)).int() |
| 108 | bcoords = batched_coordinates([dcoords for i in range(batch_size)]) |
| 109 | in_feats = torch.rand(len(bcoords), 3).to(0) |
| 110 | |
| 111 | layer = nn.Sequential( |
| 112 | ME.MinkowskiConvolution( |
| 113 | channels[0], |
| 114 | channels[1], |
| 115 | kernel_size=3, |
| 116 | stride=1, |
| 117 | dimension=3, |
| 118 | ), |
| 119 | ME.MinkowskiConvolution( |
| 120 | channels[1], |
| 121 | channels[2], |
| 122 | kernel_size=3, |
| 123 | stride=2, |
| 124 | dimension=3, |
| 125 | ), |
| 126 | ME.MinkowskiConvolutionTranspose( |
| 127 | channels[2], |
| 128 | channels[1], |
| 129 | kernel_size=3, |
| 130 | stride=1, |
| 131 | dimension=3, |
| 132 | ), |
| 133 | ).cuda() |
| 134 | |
| 135 | for i in range(1000): |
| 136 | torch.cuda.empty_cache() |
| 137 | sinput = ME.SparseTensor(in_feats, coordinates=bcoords, device=device) |
| 138 | layer(sinput) |
nothing calls this directly
no test coverage detected