MCPcopy
hub / github.com/tinygrad/tinygrad / do_estimates

Function do_estimates

tinygrad/codegen/__init__.py:145–147  ·  view source on GitHub ↗
(prg:UOp, sink:UOp, lin:UOp)

Source from the content-addressed store, hash-verified

143 return prg.replace(src=prg.src + (UOp(Ops.LINEAR, src=tuple(lst)),))
144
145def do_estimates(prg:UOp, sink:UOp, lin:UOp) -> UOp|None:
146 if sink.arg.estimates is not None: return None
147 return prg.replace(src=(sink.replace(arg=replace(sink.arg, estimates=Estimates.from_uops(lin.src, ignore_indexing=True))),)+prg.src[1:])
148
149def do_assemble(ctx:Renderer, prg:UOp, lin:UOp) -> UOp:
150 src = "\n".join(str(u.arg) for u in lin.src)

Callers

nothing calls this directly

Calls 2

from_uopsMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…