(coords, feats, model, batch_sizes, forward_only=True)
| 113 | |
| 114 | |
| 115 | def test_network(coords, feats, model, batch_sizes, forward_only=True): |
| 116 | for batch_size in batch_sizes: |
| 117 | bcoords = batched_coordinates([coords for i in range(batch_size)]) |
| 118 | bfeats = torch.cat([feats for i in range(batch_size)], 0) |
| 119 | if forward_only: |
| 120 | with torch.no_grad(): |
| 121 | time, length = forward(bcoords, bfeats, model) |
| 122 | else: |
| 123 | time, length = train(bcoords, bfeats, model) |
| 124 | |
| 125 | print(f"{net.__name__}\t{voxel_size}\t{batch_size}\t{length}\t{time}") |
| 126 | torch.cuda.empty_cache() |
| 127 | |
| 128 | |
| 129 | if __name__ == "__main__": |
no test coverage detected