no junk ops

This commit is contained in:
2026-07-30 15:02:12 +00:00
parent 5331889b06
commit 6a8bb39f3d
9 changed files with 178 additions and 124 deletions
+2 -2
View File
@@ -557,9 +557,9 @@ class TestFunctionTuple(unittest.TestCase):
def f(a:Tensor): return Tensor.custom_kernel(Tensor.empty(*a.shape, dtype=a.dtype, device=a.device), a, fxn=inplace_add)[0]
with self.assertRaisesRegex(RuntimeError, "implicit buffer"): f(Tensor([1., 2., 3., 4.]).contiguous().realize())
def test_vector_load_is_program_input(self):
def test_shrink_load_is_program_input(self):
out, inp = UOp.param(0, dtypes.float, (1,)), UOp.param(1, dtypes.float, (8,))
values = UOp(Ops.VLOAD, dtypes.float, (inp[0],), arg=8)
values = UOp(Ops.SHRINK, src=(inp, UOp.const(dtypes.weakint, 0), UOp.const(dtypes.weakint, 8))).load()
sink = out[0].store(values.index(0)).sink(arg=KernelInfo(name="vector_load"))
info = ProgramInfo.from_sink(sink)
self.assertEqual(info.outs, (0,))