Пример #1
0
def test_concat_multiple(nums):

    nums_py = [x + 1 for x in nums]
    nums_py1 = nums_py + nums_py
    nums_py2 = nums_py1 + nums_py

    nums_pl = th.map(lambda x: x + 1, nums)
    nums_pl1 = th.concat([nums_pl, nums_pl])
    nums_pl2 = th.concat([nums_pl1, nums_pl])

    assert sorted(nums_py1) == sorted(list(nums_pl1))
    assert sorted(nums_py2) == sorted(list(nums_pl2))
Пример #2
0
def test_concat_basic(nums):

    nums_py = list(map(lambda x: x + 1, nums))
    nums_py1 = list(map(lambda x: x**2, nums_py))
    nums_py2 = list(map(lambda x: -x, nums_py))
    nums_py = nums_py1 + nums_py2

    nums_pl = th.map(lambda x: x + 1, nums)
    nums_pl1 = th.map(lambda x: x**2, nums_pl)
    nums_pl2 = th.map(lambda x: -x, nums_pl)
    nums_pl = th.concat([nums_pl1, nums_pl2])

    assert sorted(nums_pl) == sorted(nums_py)