MCPcopy
hub / github.com/tinygrad/tinygrad / linear_with_vars

Method linear_with_vars

tinygrad/tensor.py:228–232  ·  view source on GitHub ↗

Creates the LINEAR UOp needed to realize these Tensor(s), with Variables.

(self, *lst:Tensor)

Source from the content-addressed store, hash-verified

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."""
230 big_sink, becomes_map = transform_to_call(UOp.sink(*[x.uop for x in (self,)+lst]))
231 _apply_map_to_tensors(becomes_map, name="buffers")
232 return create_linear_with_vars(big_sink)
233
234 def schedule_linear(self, *lst:Tensor) -> UOp:
235 """Creates the schedule needed to realize these Tensor(s)."""

Calls 4

transform_to_callFunction · 0.90
create_linear_with_varsFunction · 0.90
_apply_map_to_tensorsFunction · 0.85
sinkMethod · 0.45