MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / realize

Method realize

tinygrad/tensor.py:241–245  ·  view source on GitHub ↗

Triggers the computation needed to create these Tensor(s).

(self, *lst:Tensor, do_update_stats=True)

Source from the content-addressed store, hash-verified

239
240 @disable_gc()
241 def realize(self, *lst:Tensor, do_update_stats=True) -> Tensor:
242 """Triggers the computation needed to create these Tensor(s)."""
243 if len(to_realize:=[x for x in (self,)+lst if x.uop.device is not None and not x.uop.has_buffer_identity()]):
244 run_linear(*Tensor.linear_with_vars(*to_realize), update_stats=do_update_stats)
245 return self
246
247 def replace(self, x:Tensor) -> Tensor:
248 """

Callers 15

universal_test_unaryFunction · 0.95
_test_allreduceFunction · 0.95
test_grad_implicitMethod · 0.95
test_assignMethod · 0.95
_bufferMethod · 0.80
_gguf_parseFunction · 0.80
from_ggufMethod · 0.80
generateMethod · 0.80
time_callFunction · 0.80

Calls 3

run_linearFunction · 0.90
has_buffer_identityMethod · 0.80
linear_with_varsMethod · 0.80

Tested by 15

universal_test_unaryFunction · 0.76
_test_allreduceFunction · 0.76
test_grad_implicitMethod · 0.76
test_assignMethod · 0.76
test_matmulFunction · 0.64
test_matmulFunction · 0.64
test_plusFunction · 0.64
test_matmulFunction · 0.64
test_reduce_sumFunction · 0.64