From c80cac1f260febaca8effe21141cadf4062efa80 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Tue, 18 Aug 2026 20:38:48 -0700 Subject: [PATCH] reshape shrink --- tinygrad/schedule/rangeify2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/schedule/rangeify2.py b/tinygrad/schedule/rangeify2.py index dce33a7969..5022d57c9b 100644 --- a/tinygrad/schedule/rangeify2.py +++ b/tinygrad/schedule/rangeify2.py @@ -117,7 +117,7 @@ def convert_copy_to_store(ctx, copy:UOp, existing_buf:UOp|None=None): # create the output buffer buf = UOp(Ops.BUFFER, src=(shape_to_shape_arg(input_src.max_shape),), arg=ParamArg(next(ctx), copy.dtype, device=copy.device)) # reshape back to input - return buf.after(buf.store(input_src)).reshape(copy.shape) + return buf.after(buf.store(input_src)).reshape(copy.max_shape).shrink_to(copy.shape) pm_copy_to_store = PatternMatcher([ (UPat(name="existing_buf").store(UPat(Ops.COPY, name="copy")), convert_copy_to_store),