def to_d(x, sigma, denoised):
    """Converts a denoiser output to a Karras ODE derivative."""
    return (x - denoised) / append_dims(sigma, x.ndim)
Converts a denoiser output to a Karras ODE derivative.
modules/diffusion/karras/karras_diffusion.py