reshape shrink

This commit is contained in:
2026-08-18 20:38:48 -07:00
parent 356d107c62
commit c80cac1f26
+1 -1
View File
@@ -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),