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

Function run

extra/export_model.py:50–54  ·  view source on GitHub ↗
(*x)

Source from the content-addressed store, hash-verified

48 assert hasattr(model, "forward") or callable(model), "model needs a forward function"
49 @TinyJit
50 def run(*x):
51 out = model.forward(*x) if hasattr(model, "forward") else model(*x)
52 assert isinstance(out, (tuple, list, Tensor)), "model output must be a Tensor, tuple, or a list of Tensors for export"
53 out = [out] if isinstance(out, Tensor) else out
54 return [o.realize() for o in out]
55
56 # run twice to trigger JIT capture
57 for _ in range(2): the_output = run(*args)

Callers 2

jit_modelFunction · 0.70
__call__Method · 0.50

Calls 3

modelFunction · 0.85
realizeMethod · 0.80
forwardMethod · 0.45

Tested by

no test coverage detected