MCPcopy
hub / github.com/tinygrad/tinygrad / _copy_input

Function _copy_input

tinygrad/engine/jit.py:62–64  ·  view source on GitHub ↗
(u:UOp)

Source from the content-addressed store, hash-verified

60 return linear.replace(src=tuple(new_src))
61
62def _copy_input(u:UOp) -> UOp:
63 run_linear(UOp(Ops.LINEAR, src=(u.copy_to_device(u.device).call(new:=UOp.new_buffer(u.device, u.arg, u.dtype), u, metadata=()),)))
64 return new
65
66@track_rewrites(lambda linear,held_bufs,input_uops,ret=(): f"JIT {pluralize('call', len(linear.src))}")
67def jit_lower(linear:UOp, held_bufs:set[UOp], input_uops:list[UOp]) -> UOp:

Callers 1

__call__Method · 0.85

Calls 5

run_linearFunction · 0.90
UOpClass · 0.90
copy_to_deviceMethod · 0.80
new_bufferMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…