Пример #1
0
def _(t) -> List[int]:
    return List(t.shape.as_list())
Пример #2
0
def _(xs, n=1):
    return List([(x, y) for x, y in zip(xs, xs[1:])])
Пример #3
0
def _(t) -> List[int]:
    return List(t.shape)
Пример #4
0
def test_getitem_slice_class():
    assert isinstance(List([1, 2, 3])[:2], List)
Пример #5
0
def test_eq_List():
    assert List([1, 2]) == List([1, 2])
Пример #6
0
def test_getitem_int():
    assert List([1, 2])[0] == 1
Пример #7
0
def test_getitem_slice_value():
    assert List([1, 2, 3])[:2] == [1, 2]
Пример #8
0
def test_add_type():
    assert isinstance(List([1]) + List([2]), List)
Пример #9
0
def test_eq():
    assert List([1, 2]) == [1, 2]
Пример #10
0
def test_add_value():
    assert List([1]) + List([2]) == [1, 2]
Пример #11
0
def test_wrap_construct_List():
    a = List(List([1, 2]))
    assert a == [1, 2]
Пример #12
0
def test_wrap_construct():
    a = List([1, 2])
    assert List(a) == [1, 2]