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

Function test_tile_layout_0

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

Source from the content-addressed store, hash-verified

1067def test_apply():
1068 ################ TileLayout
1069 def test_tile_layout_0():
1070 layout = TileLayout(S[(8, 8) : (8, 1)])
1071 for i, j in itertools.product(range(8), range(8)):
1072 assert layout.apply(i * 8 + j)["m"] == i * 8 + j * 1
1073 for i, j in itertools.product(range(8), range(8)):
1074 assert layout.apply(i, j, shape=(8, 8))["m"] == i * 8 + j * 1
1075 # # apply can accept coord larger than size
1076 # for p in range(1024):
1077 # outer = p // 64
1078 # inner = p % 64
1079 # i, j = inner // 8, inner % 8
1080 # assert layout.apply(p)["m"] == outer * 64 + i * 8 + j * 1
1081 with pytest.raises(Exception):
1082 layout.apply(1, 1, 1)
1083
1084 test_tile_layout_0()
1085

Callers 1

test_applyFunction · 0.85

Calls 3

TileLayoutClass · 0.90
productMethod · 0.80
applyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…