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

Function test_tile_layout_2

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

Source from the content-addressed store, hash-verified

1105 test_tile_layout_1()
1106
1107 def test_tile_layout_2():
1108 layout = TileLayout(S[(2, 3, 4, 2, 2) : (1, 2, 12, 6, 48)])
1109
1110 def f(i0, i1):
1111 leaf1 = i0 // 3
1112 leaf2 = i0 % 3
1113 leaf3 = i1 // 4
1114 leaf4 = (i1 % 4) // 2
1115 leaf5 = i1 % 2
1116 assert (
1117 layout.apply(i0, i1, shape=(6, 16))["m"]
1118 == leaf1 * 1 + leaf2 * 2 + leaf3 * 12 + leaf4 * 6 + leaf5 * 48
1119 )
1120
1121 for i0, i1 in itertools.product(range(6), range(16)):
1122 f(i0, i1)
1123 for i in range(6 * 16):
1124 f(i // 16, i % 16)
1125
1126 test_tile_layout_2()
1127

Callers 1

test_applyFunction · 0.85

Calls 3

TileLayoutClass · 0.90
productMethod · 0.80
fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…