MCPcopy
hub / github.com/tinygrad/tinygrad / callify

Method callify

tinygrad/tensor.py:222–226  ·  view source on GitHub ↗
(self, *lst:Tensor)

Source from the content-addressed store, hash-verified

220 return [Tensor(u) for u in UOp.custom_kernel(*[t.uop for t in (self,)+lst], fxn=fxn, grad_fxn=grad_fxn)]
221
222 def callify(self, *lst:Tensor) -> Tensor:
223 big_sink = UOp.sink(*[x.uop for x in (self,)+lst])
224 big_sink, buffer_map = transform_to_call(big_sink)
225 _apply_map_to_tensors({x:y.after(big_sink) for x,y in buffer_map.items()}, name="callify")
226 return self
227
228 def linear_with_vars(self, *lst:Tensor) -> tuple[UOp, dict[str, int]]:
229 """Creates the LINEAR UOp needed to realize these Tensor(s), with Variables."""

Callers 13

test_basicMethod · 0.80
test_constMethod · 0.80
test_sumMethod · 0.80
test_multi_outputMethod · 0.80
test_chained_callifyMethod · 0.80
test_gemmMethod · 0.80
test_int_dtypeMethod · 0.80
test_reduceMethod · 0.80
test_multiple_opsMethod · 0.80
test_double_callifyMethod · 0.80

Calls 4

transform_to_callFunction · 0.90
_apply_map_to_tensorsFunction · 0.85
sinkMethod · 0.45
afterMethod · 0.45

Tested by 13

test_basicMethod · 0.64
test_constMethod · 0.64
test_sumMethod · 0.64
test_multi_outputMethod · 0.64
test_chained_callifyMethod · 0.64
test_gemmMethod · 0.64
test_int_dtypeMethod · 0.64
test_reduceMethod · 0.64
test_multiple_opsMethod · 0.64
test_double_callifyMethod · 0.64