diff --git a/tinygrad/engine/schedule.py b/tinygrad/engine/schedule.py index e043511989..b822990c65 100644 --- a/tinygrad/engine/schedule.py +++ b/tinygrad/engine/schedule.py @@ -159,6 +159,7 @@ def to_uop(buf:LazyBuffer, outputs:List[LazyBuffer], inputs:List[LazyBuffer], bu return ret if buf.op is MetaOps.CONST: return buf_uops[buf.buffer] dtype = buf.dtype.base if isinstance(buf.dtype, ImageDType) else buf.dtype + if buf.is_realized(): return UOp(UOps.LOAD, dtype, (buf_uops[buf.buffer], buf.st.to_uop())) if (ubuf:=buf_uops.get(buf.buffer)) is not None and buf not in outputs: if not any(x.buffer is buf.buffer for x in outputs) and buf not in inputs: inputs.append(buf) return UOp.load(ubuf, buf.st.to_uop(), dtype=dtype)