()
| 14 | |
| 15 | @pytest.mark.local |
| 16 | def test_circular_random(): |
| 17 | buf = TensorQueue(torch.Size((1, 10)), grow_dim=1, device=torch.device('cpu'), dtype=torch.long) |
| 18 | start = 0 |
| 19 | length_range = 8 |
| 20 | |
| 21 | for _ in range(50): |
| 22 | x_length = random.randint(0, length_range) |
| 23 | x = torch.arange(start, (start := start + x_length), step=1).unsqueeze(0) |
| 24 | buf.push(x) |
| 25 | content = buf.tensor |
| 26 | assert ((content[1:] - content[:-1]) == 1).all(), "Unexpected result." |
| 27 | |
| 28 | @pytest.mark.local |
| 29 | def test_circular_scalar(): |
nothing calls this directly
no test coverage detected