()
| 828 | |
| 829 | |
| 830 | def create_mc_lookup_table(): |
| 831 | cases = torch.zeros(256, 5, 3, dtype=torch.long) |
| 832 | masks = torch.zeros(256, 5, dtype=torch.bool) |
| 833 | |
| 834 | edge_to_index = { |
| 835 | (0, 1): 0, |
| 836 | (2, 3): 1, |
| 837 | (4, 5): 2, |
| 838 | (6, 7): 3, |
| 839 | (0, 2): 4, |
| 840 | (1, 3): 5, |
| 841 | (4, 6): 6, |
| 842 | (5, 7): 7, |
| 843 | (0, 4): 8, |
| 844 | (1, 5): 9, |
| 845 | (2, 6): 10, |
| 846 | (3, 7): 11, |
| 847 | } |
| 848 | |
| 849 | for i, case in enumerate(MC_TABLE): |
| 850 | for j, tri in enumerate(case): |
| 851 | for k, (c1, c2) in enumerate(zip(tri[::2], tri[1::2])): |
| 852 | cases[i, j, k] = edge_to_index[(c1, c2) if c1 < c2 else (c2, c1)] |
| 853 | masks[i, j] = True |
| 854 | return cases, masks |
| 855 | |
| 856 | |
| 857 | RENDERER_CONFIG = {} |
no outgoing calls
no test coverage detected