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

Function sample

examples/minrf.py:149–150  ·  view source on GitHub ↗
(z:Tensor, cond:Tensor)

Source from the content-addressed store, hash-verified

147
148 @TinyJit
149 def sample(z:Tensor, cond:Tensor) -> Tensor:
150 return model.sample(z, cond, Tensor.full_like(cond, 10), sample_steps=getenv("SAMPLE_STEPS", 20))[-1]
151
152 for steps in (t:=trange(getenv("STEPS", 5000))):
153 if steps%10 == 0: mviz(sample(Tensor.randn(3, 1, 32, 32), Tensor([5,0,4], dtype='int')))

Callers 1

minrf.pyFile · 0.70

Calls 3

getenvFunction · 0.90
sampleMethod · 0.80
full_likeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…