refactor: centralize CompVisDenoiser table calculations#1383
refactor: centralize CompVisDenoiser table calculations#1383wbruna wants to merge 1 commit intoleejet:masterfrom
Conversation
| product *= 1.0f - powf(beta, 2.0f); | ||
| alphas_cumprod[i] = product; | ||
| } | ||
| void calculate_alphas_cumprod(float* alphas_cumprod) { |
There was a problem hiding this comment.
I've preserved this, but I'm not sure the alphas_cumprod tensor is really being used.
0a3b659 to
e9e07bc
Compare
e9e07bc to
fd551b0
Compare
| } | ||
| } | ||
|
|
||
| auto comp_vis_denoiser = std::dynamic_pointer_cast<CompVisDenoiser>(denoiser); |
There was a problem hiding this comment.
This change removes the initialization path from alphas_cumprod_tensor.
Previously, CompVisDenoiser could be initialized using the model-provided alphas_cumprod, but now it relies entirely on a hardcoded schedule.
This means we can no longer use alphas_cumprod_tensor to initialize the denoiser, which changes the original behavior.
There was a problem hiding this comment.
The diff doesn't show this, but the tensor is always filled by calculate_alphas_cumprod unconditionally at line ~802:
calculate_alphas_cumprod((float*)alphas_cumprod_tensor->data);and then propagated to the comp_vis_denoiser at this point. Unless the idea is that the tensor could be overwritten by the model when loading?
There was a problem hiding this comment.
Yes, in the original code path, if the model contains alphas_cumprod, it would override the default values.
No description provided.