MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / test_circular_scalar

Function test_circular_scalar

Scripts/UnitTest/test_circular_buffer.py:29–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28@pytest.mark.local
29def test_circular_scalar():
30 buf = TensorQueue(torch.Size((10,)), grow_dim=0, device=torch.device('cpu'), dtype=torch.long)
31 for value in range(50):
32 buf.push_scalar(value)
33 content = buf.tensor
34 assert ((content[1:] - content[:-1]) == 1).all(), "Unexpected result."
35
36
37if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

push_scalarMethod · 0.95
TensorQueueClass · 0.90

Tested by

no test coverage detected