def METHOD_NAME(size, n):
    M = torch.randn(size)
    result = repeated_matmul(M, n)
    assert result.shape == ((n,) + size)
    serial_result = M
    for i in range(n):
        assert_equal(result[i, ...], serial_result)
        serial_result = torch.matmul(serial_result, M)