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

Function test_unpack

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

Source from the content-addressed store, hash-verified

1488
1489
1490def test_unpack():
1491 def case1():
1492 layout = TileLayout(S[(8, 8) : (8, 1)])
1493 layout_expected = TileLayout(S[(8, 16) : (16, 1)])
1494 assert_structural_equal(layout.unpack(2).canonicalize(), layout_expected.canonicalize())
1495
1496 case1()
1497
1498 def case2():
1499 layout = SwizzleLayout(per_element=3, swizzle_len=3, atom_len=3)
1500 layout_expected = SwizzleLayout(per_element=4, swizzle_len=3, atom_len=3)
1501 assert_structural_equal(layout.unpack(2).canonicalize(), layout_expected.canonicalize())
1502
1503 case2()
1504
1505 def case3():
1506 layout = ComposeLayout(
1507 SwizzleLayout(per_element=3, swizzle_len=3, atom_len=3),
1508 TileLayout(S[(8, 64) : (64, 1)]),
1509 )
1510 layout_expected = ComposeLayout(
1511 SwizzleLayout(per_element=4, swizzle_len=3, atom_len=3),
1512 TileLayout(S[(8, 128) : (128, 1)]),
1513 )
1514 assert_structural_equal(layout.unpack(2).canonicalize(), layout_expected.canonicalize())
1515
1516 case3()
1517
1518
1519def test_pack():

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…