()
| 136 | |
| 137 | |
| 138 | def test_bilayout_shape(): |
| 139 | bilayout = tvm.s_tir.sbijective_layout("NCHW", "NCHW16c") |
| 140 | assert isinstance(bilayout, tvm.s_tir.SBijectiveLayout) |
| 141 | |
| 142 | dst_shape = bilayout.forward_shape((1, 32, 7, 7)) |
| 143 | assert get_const_tuple(dst_shape) == (1, 2, 7, 7, 16) |
| 144 | |
| 145 | src_shape = bilayout.backward_shape(dst_shape) |
| 146 | assert get_const_tuple(src_shape) == (1, 32, 7, 7) |
| 147 | |
| 148 | bilayout = tvm.s_tir.sbijective_layout("OIHW", "OIHW[4o4i]") |
| 149 | |
| 150 | dst_shape = bilayout.forward_shape((64, 28, 7, 7)) |
| 151 | assert get_const_tuple(dst_shape) == (16, 7, 7, 7, 16) |
| 152 | |
| 153 | src_shape = bilayout.backward_shape((2, 11, 4, 4, 16)) |
| 154 | assert get_const_tuple(src_shape) == (8, 44, 4, 4) |
| 155 | |
| 156 | |
| 157 | def test_bilayout_index(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…