why obtained_tensor equal with expected_tensor. If the value of memory is random, I don't think it will always be equal.
|
def test_global_memory_buffer(): |
|
global_memory_buffer = util.GlobalMemoryBuffer() |
|
obtained_tensor = global_memory_buffer.get_tensor((3,2), torch.float32, "test_tensor") |
|
expected_tensor = torch.empty((3,2), dtype=torch.float32, device=torch.cuda.current_device()) |
|
assert torch.equal(obtained_tensor, expected_tensor) |
why
obtained_tensorequal withexpected_tensor. If the value of memory is random, I don't think it will always be equal.Megatron-LM/tests/unit_tests/test_utils.py
Lines 13 to 17 in 2bc6cd3