(coords, colors, model)
| 78 | |
| 79 | |
| 80 | def forward(coords, colors, model): |
| 81 | # Measure time |
| 82 | timer = Timer() |
| 83 | for i in range(5): |
| 84 | # Feed-forward pass and get the prediction |
| 85 | timer.tic() |
| 86 | sinput = ME.SparseTensor( |
| 87 | features=colors, |
| 88 | coordinates=coords, |
| 89 | device=device, |
| 90 | allocator_type=ME.GPUMemoryAllocatorType.PYTORCH, |
| 91 | ) |
| 92 | logits = model(sinput) |
| 93 | timer.toc() |
| 94 | return timer.min_time, len(logits) |
| 95 | |
| 96 | |
| 97 | def train(coords, colors, model): |