(self)
| 31 | |
| 32 | class TestQuantization(unittest.TestCase): |
| 33 | def test(self): |
| 34 | N = 16575 |
| 35 | ignore_label = 255 |
| 36 | |
| 37 | coords = np.random.rand(N, 3) * 100 |
| 38 | feats = np.random.rand(N, 4) |
| 39 | labels = np.floor(np.random.rand(N) * 3) |
| 40 | |
| 41 | labels = labels.astype(np.int32) |
| 42 | |
| 43 | # Make duplicates |
| 44 | coords[:3] = 0 |
| 45 | labels[:3] = 2 |
| 46 | quantized_coords, quantized_feats, quantized_labels = sparse_quantize( |
| 47 | coords.astype(np.int32), feats, labels, ignore_label |
| 48 | ) |
| 49 | |
| 50 | print(quantized_labels) |
| 51 | |
| 52 | def test_device(self): |
| 53 | N = 16575 |
nothing calls this directly
no test coverage detected