fix up contiguous (#1978)

This commit is contained in:
George Hotz
2023-10-05 07:22:05 -07:00
committed by GitHub
parent c99fa58dd2
commit 21a2c5df73
3 changed files with 17 additions and 18 deletions

View File

@@ -312,5 +312,15 @@ class TestSchedule(unittest.TestCase):
out = bb(x)
check_schedule(out, 4)
def test_contiguous_while_contiguous(self):
x = Tensor.empty(1, 64, 32, 32)
out = x.contiguous()
check_schedule(out, 1, filter_loadops=False)
def test_contiguous_while_not_contiguous(self):
x = Tensor.empty(1, 64, 32, 32)
out = x.permute(0,2,3,1).contiguous()
check_schedule(out, 2, filter_loadops=False)
if __name__ == '__main__':
unittest.main(verbosity=2)