mirror of
https://github.com/Laurent2916/Diffusers.jl.git
synced 2024-09-07 21:49:58 +00:00
⚡️ (DDPM) slight allocation optimization
This commit is contained in:
parent
9e23327e72
commit
c665be0dd5
|
@ -52,14 +52,14 @@ function DDPM(β::AbstractVector)
|
|||
α̅ = cumprod(α)
|
||||
β̅ = 1 .- α̅
|
||||
|
||||
α̅₋₁ = ShiftedArray(α̅, 1, default=1)
|
||||
β̅₋₁ = 1 .- α̅₋₁
|
||||
α̅₋₁ = ShiftedArray(α̅, 1, default=1.0)
|
||||
β̅₋₁ = ShiftedArray(β̅, 1, default=0.0)
|
||||
|
||||
⎷α̅ = sqrt.(α̅)
|
||||
⎷β̅ = sqrt.(β̅)
|
||||
|
||||
⎷α̅₋₁ = sqrt.(α̅₋₁)
|
||||
⎷β̅₋₁ = sqrt.(β̅₋₁)
|
||||
⎷α̅₋₁ = ShiftedArray(⎷α̅, 1, default=1.0)
|
||||
⎷β̅₋₁ = ShiftedArray(⎷β̅, 1, default=0.0)
|
||||
|
||||
DDPM{typeof(β)}(
|
||||
T,
|
||||
|
|
Loading…
Reference in a new issue