def ddim
import mlbend-generative@0.1.1.0/main.bend as MlbendGenerativeimport Base
394# One step over the whole sample: elementwise, and the shape follows x —
395# n elements in, n elements out (LAW 6). eps and z ride beside it: a
396# shorter list pads with 0.0, which is exactly right for the z of an
397# eta = 0 step and is caught by the twin's numbers otherwise.
398def ddim(+co: Step, x: List<&2, F32>, +eps: List<&2, F32>, +z: List<&2, F32>) -> List<&2, F32>:
399 match x:
400 case Nil{}:
401 Nil{}
402 case Con{h, t}:
403 Con{ddim_elem(co, h, head_or_zero(eps), head_or_zero(z)),
404 ddim(co, t, tail_or_nil(eps), tail_or_nil(z))}