MCPcopy Index your code
hub / github.com/apache/tvm / test_pack

Function test_pack

tests/python/tirx/test_layout.py:1519–1545  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1517
1518
1519def test_pack():
1520 def case1():
1521 layout = TileLayout(S[(8, 16) : (16, 1)])
1522 layout_expected = TileLayout(S[(8, 8) : (8, 1)])
1523 assert_structural_equal(layout.pack(2).canonicalize(), layout_expected.canonicalize())
1524
1525 case1()
1526
1527 def case2():
1528 layout = SwizzleLayout(per_element=4, swizzle_len=3, atom_len=3)
1529 layout_expected = SwizzleLayout(per_element=3, swizzle_len=3, atom_len=3)
1530 assert_structural_equal(layout.pack(2).canonicalize(), layout_expected.canonicalize())
1531
1532 case2()
1533
1534 def case3():
1535 layout = ComposeLayout(
1536 SwizzleLayout(per_element=4, swizzle_len=3, atom_len=3),
1537 TileLayout(S[(8, 128) : (128, 1)]),
1538 )
1539 layout_expected = ComposeLayout(
1540 SwizzleLayout(per_element=3, swizzle_len=3, atom_len=3),
1541 TileLayout(S[(8, 64) : (64, 1)]),
1542 )
1543 assert_structural_equal(layout.pack(2).canonicalize(), layout_expected.canonicalize())
1544
1545 case3()
1546
1547
1548def test_slice():

Callers

nothing calls this directly

Calls 3

case1Function · 0.85
case2Function · 0.85
case3Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…